﻿.home-page {
    background: var(--home-bg);
    color: var(--home-text);
    padding-bottom: 48px;
}

.home-page *,
.home-page *::before,
.home-page *::after {
    box-sizing: border-box;
}

.home-page a {
    color: inherit;
    text-decoration: none;
}

.home-container {
    width: min(1200px, calc(100% - 48px));
    margin-inline: auto;
}

.home-hero {
    overflow: hidden;
    background: var(--home-soft);
}

.home-hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    min-height: 560px;
    gap: 32px;
}

.home-hero-copy {
    position: relative;
    z-index: 1;
    padding-block: 52px;
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--home-surface);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
}

    .home-eyebrow svg {
        color: var(--home-accent);
    }

.home-title {
    max-width: 620px;
    margin: 24px 0 20px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.035em;
}

.home-page[dir="rtl"] .home-title {
    font-family: inherit;
    line-height: 1.35;
    letter-spacing: 0;
}

.home-title span {
    color: var(--home-accent);
}

.home-description {
    max-width: 370px;
    color: var(--home-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 700;
    transition: background .18s ease, transform .18s ease;
}

.home-page .home-button-primary {
    background: var(--home-accent);
    color: #fff;
}

    .home-page .home-button-primary:hover {
        background: var(--home-accent-hover);
        transform: translateY(-2px);
    }

.home-page .home-button-outline {
    border-color: var(--home-accent);
    color: var(--home-text);
    background: transparent;
}

    .home-page .home-button-outline:hover {
        background: var(--home-surface);
    }

.home-hero-visual {
    position: relative;
    align-self: stretch;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 460px;
}

    .home-hero-visual::before {
        content: "";
        position: absolute;
        width: 92%;
        aspect-ratio: 1;
        bottom: 12px;
        border-radius: 50%;
        background: #f27b70;
    }

.home-hero-image {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    object-position: bottom;
}

.home-hero-note {
    position: absolute;
    z-index: 2;
    bottom: 28px;
    inset-inline-start: 12px;
    max-width: 290px;
    padding: 16px 22px;
    border: 1px solid var(--home-border);
    border-radius: 999px;
    background: var(--home-surface);
    box-shadow: var(--home-shadow);
    font-size: .85rem;
}

    .home-hero-note strong,
    .home-hero-note span {
        display: block;
    }

    .home-hero-note span {
        margin-top: 4px;
        color: var(--home-muted);
    }

.home-benefits {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: -12px;
    padding: 28px;
    border: 1px solid var(--home-border);
    border-radius: 26px;
    background: var(--home-surface);
    box-shadow: var(--home-shadow);
}

.home-benefit {
    display: flex;
    align-items: center;
    gap: 14px;
}

.home-icon {
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--home-soft);
    color: var(--home-accent);
}

    .home-icon svg {
        width: 25px;
        height: 25px;
    }

.home-benefit h3 {
    margin: 0 0 5px;
    font-size: .9rem;
    font-weight: 700;
}

.home-benefit p {
    margin: 0;
    color: var(--home-muted);
    font-size: .8rem;
    line-height: 1.6;
}

.home-section {
    margin-top: 38px;
}

.home-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

    .home-section-heading h2 {
        margin: 0;
        font-size: 1.4rem;
        font-weight: 700;
    }

.home-page .home-section-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--home-accent);
    font-size: .85rem;
    font-weight: 700;
}

.home-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.home-category {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    min-height: 180px;
    padding: 16px;
    border: 1px solid var(--home-border);
    border-radius: 20px;
    background: #fae7d5;
    transition: transform .18s ease;
}

    .home-category:nth-child(5n + 2) {
        background: #fcf0d4;
    }

    .home-category:nth-child(5n + 3) {
        background: #e0e8dc;
    }

    .home-category:nth-child(5n + 4) {
        background: #fae0df;
    }

    .home-category:nth-child(5n + 5) {
        background: #efdee5;
    }

html[data-theme="dark"] .home-category {
    background: var(--home-soft);
}

.home-category:hover {
    transform: translateY(-4px);
}

.home-category-image {
    width: 48%;
    height: 145px;
    object-fit: contain;
    border-radius: 12px;
}

.home-category-copy {
    flex: 1;
    min-width: 0;
}

.home-category h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.home-category p {
    margin: 0 0 10px;
    font-size: .8rem;
}

.home-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.home-product {
    overflow: hidden;
    border: 1px solid var(--home-border);
    border-radius: 18px;
    background: var(--home-surface);
    box-shadow: var(--home-shadow);
    transition: transform .18s ease, border-color .18s ease;
}

    .home-product:hover {
        transform: translateY(-4px);
        border-color: var(--home-accent);
    }

.home-product-media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: var(--home-soft);
}

    .home-product-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .3s ease;
    }

.home-product:hover .home-product-media img {
    transform: scale(1.04);
}

.home-product-badge {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--home-accent);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
}

.home-product-body {
    padding: 16px;
}

    .home-product-body h3 {
        margin: 0 0 8px;
        font-size: .95rem;
        font-weight: 700;
        line-height: 1.5;
    }

.home-product-category {
    margin: 0 0 10px;
    color: var(--home-muted);
    font-size: .8rem;
}

.home-product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.home-price {
    color: var(--home-accent);
    font-weight: 700;
}

.home-old-price {
    display: block;
    margin-top: 3px;
    color: var(--home-muted);
    font-size: .8rem;
    font-weight: 400;
}

.home-page .home-product-link {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--home-accent);
    border-radius: 10px;
    color: var(--home-accent);
}

.home-product-link svg {
    width: 20px;
    height: 20px;
}

.home-promo {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    overflow: hidden;
    min-height: 240px;
    border-radius: 24px;
    background: #ec6257;
    color: #fff;
}

.home-promo-copy {
    position: relative;
    z-index: 1;
    padding: 36px;
}

.home-promo h2 {
    margin: 0 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    font-weight: 700;
}

.home-page[dir="rtl"] .home-promo h2 {
    font-family: inherit;
}

.home-promo p {
    margin-bottom: 20px;
    line-height: 1.7;
}

.home-page .home-promo-button {
    background: #fff6ed;
    color: #24211e;
}

.home-promo-image {
    width: 100%;
    height: 100%;
    max-height: 300px;
    object-fit: cover;
}

.home-bottom-benefits {
    margin-top: 28px;
    background: var(--home-soft);
    box-shadow: none;
}

.home-image-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--home-muted);
}

    .home-image-placeholder svg {
        width: 64px;
        height: 64px;
    }

.home-arrow {
    width: 18px;
    height: 18px;
}

.home-page[dir="rtl"] .home-arrow {
    transform: rotate(180deg);
}

.home-page a:focus-visible,
.home-page button:focus-visible {
    outline: 3px solid var(--home-accent);
    outline-offset: 4px;
}

@media (max-width: 991px) {
    .home-hero-inner {
        min-height: 440px;
        gap: 20px;
    }

    .home-hero-visual {
        min-height: 380px;
    }

    .home-benefits {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .home-container {
        width: calc(100% - 32px);
    }

    .home-hero-inner {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .home-hero-copy {
        padding-block: 32px 20px;
    }

    .home-title {
        font-size: 2.6rem;
    }

    .home-hero-visual {
        min-height: 320px;
    }

    .home-hero-image {
        max-height: 380px;
    }

    .home-hero-note {
        bottom: 20px;
        inset-inline-start: 8px;
        padding: 12px 18px;
    }

    .home-benefits {
        gap: 18px 12px;
        padding: 20px 16px;
        border-radius: 20px;
    }

    .home-benefit {
        align-items: flex-start;
        gap: 8px;
    }

    .home-icon {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

        .home-icon svg {
            width: 20px;
            height: 20px;
        }

    .home-benefit h3 {
        font-size: .8rem;
    }

    .home-benefit p {
        font-size: .72rem;
    }

    .home-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .home-category {
        min-height: 150px;
        padding: 10px;
        gap: 8px;
    }

    .home-category-image {
        height: 115px;
    }

    .home-category h3 {
        font-size: .85rem;
    }

    .home-product-grid {
        gap: 12px;
    }

    .home-product-body {
        padding: 12px;
    }

        .home-product-body h3 {
            font-size: .85rem;
        }

    .home-promo {
        grid-template-columns: 1fr;
    }

    .home-promo-copy {
        padding: 28px;
    }

    .home-promo-image {
        max-height: 220px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page *,
    .home-page *::before,
    .home-page *::after {
        transition: none !important;
    }
}

.home-product {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.home-product-body {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.home-product .home-product-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 12px;
    font-size: .75rem;
    line-height: 1.6;
}

.home-product .home-product-category {
    margin: 0;
    color: var(--home-muted);
    font-size: inherit;
}

.home-product .home-product-barcode {
    min-width: 0;
    color: var(--home-muted);
    overflow-wrap: anywhere;
}

.home-product .home-product-availability {
    margin-inline-start: auto;
    font-weight: 600;
    white-space: nowrap;
}

    .home-product .home-product-availability.is-available {
        color: var(--store-success);
    }

    .home-product .home-product-availability.is-unavailable {
        color: var(--home-muted);
    }

.home-product .home-product-bottom {
    margin-top: auto;
    padding-top: 8px;
}

.home-product .home-price {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.home-product .home-price-regular {
    color: var(--store-success);
}

.home-product .home-price-discounted {
    color: var(--store-danger);
}

.home-product .home-old-price {
    display: block;
    margin: 0;
    color: var(--home-muted);
    font-size: .8rem;
    font-weight: 400;
}

.home-product .home-current-price {
    color: inherit;
    font-size: 1rem;
    font-weight: 700;
}
.home-product .home-product-meta {
    gap: 8px 12px;
    font-size: .85rem;
    font-weight: 700;
    line-height: 1.7;
}

.home-product .home-product-category,
.home-product .home-product-barcode {
    color: var(--home-text);
    font-size: inherit;
    font-weight: 700;
}

.home-product .home-product-availability {
    font-size: inherit;
    font-weight: 700;
}

    .home-product .home-product-availability.is-available {
        color: #008a3e;
    }

html[data-theme="dark"]
.home-product .home-product-availability.is-available {
    color: #4ade80;
}

/* Category cards */
#categories .home-category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

#categories .home-category {
    position: relative;
    display: block;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 4 / 5;
    padding: 0;
    overflow: hidden;
    background: var(--home-soft);
    border: 1px solid var(--home-border);
    border-radius: 20px;
    box-shadow: var(--home-shadow);
    transition: transform .2s ease, border-color .2s ease;
}

    #categories .home-category:hover {
        transform: translateY(-4px);
        border-color: var(--home-accent);
    }

/* الصورة تغطي البطاقة بالكامل */
#categories .home-category-visual {
    position: absolute;
    inset: 0;
    display: block;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

#categories .home-category-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    transition: transform .35s ease;
}

#categories .home-category:hover .home-category-image {
    transform: scale(1.05);
}

/* بديل الصورة غير المتوفرة */
#categories .home-category-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--home-muted);
    background: var(--home-soft);
}

    #categories .home-category-fallback svg {
        width: 48px;
        height: 48px;
        opacity: .6;
    }

/* المحتوى فوق الصورة */
#categories .home-category-copy {
    position: absolute;
    inset: 0;
    display: block;
    min-width: 0;
    padding: 0;
}

/* ليبيل التصنيف أعلى اليمين */
#categories .home-category-name {
    position: absolute;
    top: 12px;
    right: 12px;
    max-width: calc(100% - 24px);
    padding: 8px 14px;
    color: var(--home-text);
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .12);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: right;
    overflow-wrap: anywhere;
}

/* العدد أسفل اليمين */
#categories .home-category-count {
    position: absolute;
    bottom: 14px;
    right: 12px;
    max-width: calc(100% - 72px);
    padding: 6px 10px;
    color: var(--home-text);
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: 10px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.5;
}

/* السهم أسفل اليسار */
#categories .home-category-arrow {
    position: absolute;
    top: auto;
    right: auto;
    bottom: 12px;
    left: 12px;
    inset-inline-end: auto;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0;
    transform: none;
    color: var(--home-text);
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .12);
}

    #categories .home-category-arrow svg {
        width: 18px;
        height: 18px;
    }

@media (max-width: 1100px) {
    #categories .home-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    #categories .home-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #categories .home-category-name {
        top: 10px;
        right: 10px;
        padding: 7px 10px;
        font-size: .88rem;
    }
}
/* تثبيت السهم على اليسار في اللغتين */
#categories .home-category .home-category-arrow {
    inset-inline: auto;
    top: auto;
    bottom: 12px;
    right: auto;
    left: 12px;
    margin: 0;
    transform: none;
}

/* العدد يبقى على اليمين */
#categories .home-category .home-category-count {
    inset-inline: auto;
    right: 12px;
    left: auto;
    bottom: 14px;
}

/* إبقاء الاسم والسهم فوق اللمعة */
#categories .home-category-copy {
    z-index: 3;
}

/* شريط اللمعة */
#categories .home-category::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: -25%;
    left: -80%;
    width: 45%;
    height: 150%;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, .12), rgba(255, 255, 255, .55), rgba(255, 255, 255, .12), transparent );
    transform: skewX(-20deg);
}

#categories .home-category.is-shining::after {
    animation: category-shine .85s ease-in-out;
}

@keyframes category-shine {
    0% {
        left: -80%;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        left: 140%;
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    #categories .home-category.is-shining::after {
        animation: none;
    }
}
.home-product {
    position: relative;
    isolation: isolate;
}

    .home-product::after {
        content: "";
        position: absolute;
        z-index: 2;
        top: -25%;
        left: -80%;
        width: 45%;
        height: 150%;
        pointer-events: none;
        opacity: 0;
        background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, .12), rgba(255, 255, 255, .55), rgba(255, 255, 255, .12), transparent );
        transform: skewX(-20deg);
    }

    .home-product.is-shining::after {
        animation: category-shine .85s ease-in-out;
    }

@media (prefers-reduced-motion: reduce) {
    .home-product.is-shining::after {
        animation: none;
    }
}