/* ============================================================
   Masha Allah Enterprise — Home Page (MOBILE FIRST)
   Base: 320px → 767px is primary, desktop is enhancement.
   Includes subtle animations (reduced-motion aware).
   ============================================================ */

/* ---------- Hero Swiper — mobile base 320px ---------- */
.home-hero {
    position: relative;
    overflow: hidden;
}
.home-hero .swiper {
    width: 100%;
    /* mobile-first height */
    height: 440px;
}
.home-hero .swiper-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #0a5c2e, #0e7a3d);
}
.hero-slide-bg {
    position: absolute;
    inset: 0;
}
.hero-slide-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.22;
    transform: scale(1);
    transition: transform 7s ease;
}
.swiper-slide-active .hero-slide-bg img {
    transform: scale(1.08);
}
.hero-slide-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6,58,30,0.78) 0%, rgba(6,58,30,0.58) 50%, rgba(14,122,61,0.42) 100%);
}
.hero-slide-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 16px;
    text-align: center;
    display: flex;
    justify-content: center;
}
.hero-text {
    max-width: 560px;
    margin: 0 auto;
}
.hero-text h1 {
    font-size: 1.65rem;
    line-height: 1.18;
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 18px rgba(0,0,0,0.22);
    opacity: 0;
    transform: translateY(18px);
}
.hero-text h1 span {
    color: var(--accent);
    display: inline-block;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.28);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(10px);
}
.swiper-slide-active .hero-badge {
    animation: heroIn 0.55s ease 0.05s forwards;
}
.hero-text p {
    margin: 12px auto 0;
    color: rgba(255,255,255,0.92);
    font-size: 0.92rem;
    line-height: 1.65;
    max-width: 520px;
    opacity: 0;
    transform: translateY(14px);
}
.hero-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    justify-content: center;
    align-items: stretch;
    opacity: 0;
    transform: translateY(14px);
}
.hero-cta .btn {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    border-radius: 10px;
}
.hero-cta .btn-outline {
    border-color: #fff;
    color: #fff;
    background: rgba(255,255,255,0.10);
    backdrop-filter: blur(6px);
}
.hero-cta .btn-outline:hover,
.hero-cta .btn-outline:active {
    background: #fff;
    color: var(--primary-dark);
}

/* active slide animations */
.swiper-slide-active .hero-text h1 {
    animation: heroIn 0.65s ease 0.15s forwards;
}
.swiper-slide-active .hero-text p {
    animation: heroIn 0.65s ease 0.32s forwards;
}
.swiper-slide-active .hero-cta {
    animation: heroIn 0.65s ease 0.48s forwards;
}
@keyframes heroIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Swiper controls — mobile: smaller, hide arrows on tiny */
.home-hero .swiper-pagination {
    bottom: 14px !important;
}
.home-hero .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.55);
    opacity: 1;
    transition: all 0.3s ease;
}
.home-hero .swiper-pagination-bullet-active {
    background: var(--accent);
    width: 26px;
    border-radius: 999px;
}
.home-hero .swiper-button-next,
.home-hero .swiper-button-prev {
    display: none;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    color: #fff;
    transition: background 0.2s ease, transform 0.2s ease;
}
.home-hero .swiper-button-next::after,
.home-hero .swiper-button-prev::after {
    font-size: 14px;
    font-weight: 800;
}
.home-hero .swiper-button-next:hover,
.home-hero .swiper-button-prev:hover {
    background: var(--accent);
    transform: scale(1.06);
}

/* ---------- Container fix — mobile needs gutter, not edge-to-edge ---------- */
.page-container {
    padding-left: 16px;
    padding-right: 16px;
}
/* ---------- Services — mobile 1 col base ---------- */
.services-section {
    padding-top: 28px;
    padding-bottom: 18px;
}
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 18px 16px;
    text-align: center;
    transition: transform 0.28s cubic-bezier(0.22,1,0.36,1), box-shadow 0.28s ease, border-color 0.28s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(15,60,35,0.12); }
.service-card:active { transform: translateY(0) scale(0.98); }
.service-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 13px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}
.service-card:hover .service-icon { transform: scale(1.08) rotate(-4deg); }
.service-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--primary-dark);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.service-card h3 {
    font-size: 0.98rem;
    color: var(--primary-dark);
    margin-bottom: 5px;
}
.service-card p {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ---------- Stats bar — mobile 2x2 ---------- */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 10px;
    margin-top: 16px;
}
.stat-item {
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 8px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}
.stat-item:hover { transform: translateY(-2px); }
.stat-item strong {
    display: block;
    font-size: 1.25rem;
    color: var(--primary-dark);
    line-height: 1.1;
}
.stat-item span {
    font-size: 0.80rem;
    color: var(--text-muted);
}

/* ---------- Section heads — mobile ---------- */
.home-products { padding-top: 22px; padding-bottom: 6px; }
.section-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.section-head h2 {
    font-size: 1.25rem;
    color: var(--primary-dark);
    position: relative;
    padding-bottom: 8px;
    line-height: 1.2;
}
.section-head h2::after {
    content:"";
    position:absolute; left:0; bottom:0;
    width:42px; height:3px; border-radius:4px;
    background: var(--accent);
}
.section-head p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}
.section-head a {
    align-self: flex-start;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.88rem;
    padding: 6px 0;
    transition: color 0.2s ease, transform 0.2s ease;
}
.section-head a:hover { color: var(--primary-dark); transform: translateX(4px); }

/* ---------- Categories pill — mobile scroll ---------- */
.home-cats { padding-top: 14px; padding-bottom: 6px; }
.cat-pill-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.cat-pill-row::-webkit-scrollbar { display: none; }
.cat-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 14px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.86rem;
    transition: all 0.22s ease;
    box-shadow: var(--shadow);
    white-space: nowrap;
}
.cat-pill:hover, .cat-pill:active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
}
.cat-pill span.count {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
}
.cat-pill:hover span.count { background: rgba(255,255,255,0.22); color:#fff; }

/* ---------- Why Choose Us — mobile single col ---------- */
.why-section { padding-top: 24px; padding-bottom: 24px; }
.why-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: center;
}
.why-text h2 {
    font-size: 1.28rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    line-height: 1.25;
}
.why-text > p {
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.65;
    font-size: 0.92rem;
}
.why-list {
    list-style: none;
    display: grid;
    gap: 10px;
}
.why-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.why-list li:hover { transform: translateX(4px); box-shadow: 0 4px 12px rgba(15,60,35,0.08); }
.why-list li i {
    flex:none;
    width:26px; height:26px;
    border-radius:50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display:flex; align-items:center; justify-content:center;
    font-style: normal;
    font-weight: 800;
    font-size: 0.82rem;
    margin-top: 1px;
}
.why-list li span { font-size: 0.90rem; line-height: 1.5; }
.why-image {
    position: relative;
}
.why-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.why-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.16);
    display:flex; gap:8px; align-items:center;
}
.why-badge strong { color: var(--primary-dark); font-size: 1.05rem; }
.why-badge span { font-size: 0.82rem; color: var(--text-muted); line-height:1.3; }

/* ---------- Newsletter — mobile stacked ---------- */
.newsletter-section {
    margin-top: 24px;
    background: linear-gradient(135deg, #063a1e, #0e7a3d 60%, #12934e);
    border-radius: 0;
    margin-left: -16px;
    margin-right: -16px;
    padding: 26px 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.newsletter-section::before {
    content:"";
    position:absolute;
    width: 200px; height:200px;
    top:-50px; right:-50px;
    background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 70%);
    border-radius:50%;
    pointer-events: none;
}
.newsletter-inner {
    position: relative;
    z-index:1;
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.newsletter-text h2 {
    font-size: 1.25rem;
    margin-bottom: 6px;
    line-height: 1.25;
}
.newsletter-text p {
    opacity: 0.92;
    font-size: 0.90rem;
    line-height: 1.6;
}
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.newsletter-form input {
    flex:1;
    border:none;
    outline:none;
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    min-width:0;
    background: #f8faf9;
}
.newsletter-form input:focus { background:#fff; box-shadow: 0 0 0 2px rgba(14,122,61,0.12) inset; }
.newsletter-form button {
    border:none;
    background: var(--primary-dark);
    color:#fff;
    font-weight:700;
    padding: 13px 18px;
    border-radius: 10px;
    cursor:pointer;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease;
    font-size: 0.95rem;
}
.newsletter-form button:hover { background: var(--primary-dark); }
.newsletter-form button:active { transform: scale(0.98); }
.newsletter-form button:disabled { opacity:0.6; cursor:not-allowed; }
.newsletter-msg {
    margin-top: 8px;
    font-size: 0.86rem;
    min-height: 18px;
    line-height: 1.4;
}
.newsletter-msg.ok { color: #d1fae5; }
.newsletter-msg.err { color: #fecaca; }

/* ============================================================
   Progressive enhancement — 375px+
   ============================================================ */
@media (min-width: 375px) {
    .hero-text h1 { font-size: 1.78rem; }
    .services-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
    .service-card { padding: 16px 12px; }
    .why-image img { height: 240px; }
}

/* ============================================================
   480px+ — phablet
   ============================================================ */
@media (min-width: 480px) {
    .home-hero .swiper { height: 460px; }
    .hero-text h1 { font-size: 1.92rem; }
    .hero-text p { font-size: 0.98rem; }
    .hero-cta { flex-direction: row; align-items: center; }
    .hero-cta .btn { width: auto; flex: 0 0 auto; }
    .services-grid { gap: 12px; }
    .newsletter-section { margin-left: -16px; margin-right: -16px; padding: 28px 16px; }
    .why-image img { height: 280px; }
}

/* ============================================================
   600px+ — small tablet
   ============================================================ */
@media (min-width: 600px) {
    .section-head { flex-direction: row; align-items: end; justify-content: space-between; }
    .section-head a { align-self: auto; }
    .newsletter-form { flex-direction: row; border-radius: 999px; padding: 6px; }
    .newsletter-form input { border-radius: 999px; padding: 11px 16px; font-size: 0.96rem; background: #fff; }
    .newsletter-form button { border-radius: 999px; padding: 11px 22px; }
    .newsletter-section { border-radius: 16px; margin-left: 0; margin-right: 0; padding: 32px 24px; }
    .page-container .newsletter-section { margin-left: 0; margin-right: 0; }
}

/* ============================================================
   768px+ — tablet / desktop
   ============================================================ */
@media (min-width: 768px) {
    .page-container { padding-left: 20px; padding-right: 20px; }
    .home-hero .swiper { height: 500px; }
    .hero-slide-content { padding: 0 22px; }
    .hero-text h1 { font-size: 2.35rem; }
    .hero-text p { font-size: 1.05rem; }
    .home-hero .swiper-button-next,
    .home-hero .swiper-button-prev { display: flex; }
    .services-section { padding-top: 36px; padding-bottom: 18px; }
    .services-grid { grid-template-columns: repeat(4,1fr); gap: 16px; }
    .service-card { padding: 20px 16px; }
    .stats-bar { grid-template-columns: repeat(4,1fr); gap: 14px; }
    .stat-item strong { font-size: 1.35rem; }
    .home-products { padding-top: 30px; padding-bottom: 10px; }
    .section-head h2 { font-size: 1.5rem; }
    .why-grid { grid-template-columns: 1.1fr 0.9fr; gap: 28px; }
    .why-text h2 { font-size: 1.5rem; }
    .why-image img { height: 340px; }
    .newsletter-inner { grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: center; }
    .newsletter-text h2 { font-size: 1.45rem; }
}

/* ============================================================
   1024px+ — large desktop
   ============================================================ */
@media (min-width: 1024px) {
    .home-hero .swiper { height: 520px; }
    .hero-text h1 { font-size: 2.75rem; }
    .hero-text p { font-size: 1.12rem; }
    .services-grid { gap: 18px; }
    .service-card { padding: 24px 18px; }
    .service-card h3 { font-size: 1.02rem; }
    .why-image img { height: 380px; }
    .newsletter-text h2 { font-size: 1.55rem; }
}

/* ============================================================
   Animations — reveal + stagger (mobile friendly)
   ============================================================ */
.service-card, .why-list li, .stat-item {
    will-change: transform, opacity;
}
/* reveal-stagger delay for services on mobile */
.services-grid.reveal-stagger > *:nth-child(1) { transition-delay: 0.06s; }
.services-grid.reveal-stagger > *:nth-child(2) { transition-delay: 0.14s; }
.services-grid.reveal-stagger > *:nth-child(3) { transition-delay: 0.22s; }
.services-grid.reveal-stagger > *:nth-child(4) { transition-delay: 0.30s; }

/* subtle floating for why badge */
.why-badge { animation: badgeFloat 3.2s ease-in-out infinite; }
@keyframes badgeFloat {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .hero-slide-bg img,
    .swiper-slide-active .hero-text h1,
    .swiper-slide-active .hero-text p,
    .swiper-slide-active .hero-cta,
    .why-badge { animation: none !important; transition: none !important; }
    .hero-text h1, .hero-text p, .hero-cta { opacity: 1; transform: none; }
}
