:root {
    --bg-color: #F9F6F0;
    --primary-text: #0036a3;
    --accent-gold: #D4AF37;
    --white: #FFFFFF;
    --gray-light: #E5E5E5;
    --gray-text: #7A869A;
    --transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #fafafa;
    background-image: radial-gradient(circle at 50% 10%, #ffffff 0%, #fafafa 100%);
    color: var(--primary-text);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

html[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(11, 43, 94, 0.2);
    border-radius: 4px;
}

.app-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- GREETING & TITLE --- */
.greeting {
    padding: 24px 24px 24px;
}

.greeting p {
    color: var(--gray-text);
    font-size: 16px;
    margin-bottom: 4px;
}

.greeting h2 {
    font-size: 32px;
    font-weight: 600;
}

/* --- CATEGORIES & FILTERS --- */
.categories {
    display: flex;
    padding: 0 24px 24px;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.chip {
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid var(--accent-gold);
    color: var(--primary-text);
    transition: 0.2s;
    background: transparent;
}

.chip.active {
    background-color: var(--primary-text);
    color: var(--white);
    border-color: var(--primary-text);
}

/* --- PRODUCT GRID --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 0 24px;
}

.product-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
}

.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 16px;
}

.product-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- PAGINATION --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 32px 24px 60px;
    margin-top: auto;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--gray-light);
    background: var(--white);
    color: var(--primary-text);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.page-btn.active {
    background: var(--primary-text);
    color: var(--white);
    border-color: var(--primary-text);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- BOTTOM SHEET / MODAL --- */
#detail-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 43, 94, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 99;
}

#detail-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

#detail-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85vh;
    background-color: var(--white);
    border-radius: 32px 32px 0 0;
    transform: translateY(100%);
    transition: transform var(--transition);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

#detail-sheet.active {
    transform: translateY(0);
}

.sheet-hero {
    position: relative;
    height: 35%;
    width: 100%;
}

.sheet-hero img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #f7f7f7;
}

.sheet-nav {
    position: absolute;
    top: 16px;
    left: 0;
    width: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.sheet-content {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
    padding-bottom: 100px;
}

.handle {
    width: 40px;
    height: 5px;
    background: var(--gray-light);
    border-radius: 3px;
    margin: 0 auto 16px;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.sheet-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.sheet-desc {
    color: var(--gray-text);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.description-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed var(--gray-light);
}

.description-links a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
}

.description-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: var(--white);
    border-color: var(--accent-gold);
}

.description-links a i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 12px;
    font-size: 18px;
    background: var(--white);
    transition: var(--transition);
}

html[dir="rtl"] .description-links a i {
    margin-right: 0;
    margin-left: 12px;
}

/* Brand Specific Styles */
#link-wa i {
    color: #25D366;
    background: rgba(37, 211, 102, 0.1);
}

#link-insta i {
    color: #E1306C;
    background: rgba(225, 48, 108, 0.1);
}

#link-loc i {
    color: #0088CC;
    background: rgba(0, 136, 204, 0.1);
}

.description-links a:hover i {
    transform: rotate(10deg) scale(1.1);
}

.description-links a span {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-text);
}

#ui-val-wa {
    direction: ltr;
    display: inline-block;
}

@media (min-width: 480px) {
    .description-links {
        grid-template-columns: repeat(2, 1fr);
    }

    #link-loc {
        grid-column: span 2;
    }
}

@media (min-width: 768px) {
    .greeting {
        padding: 60px 48px 40px;
        text-align: center;
    }

    .greeting h2 {
        font-size: 48px;
        letter-spacing: -1px;
    }

    .categories {
        padding: 0 48px 48px;
        justify-content: center;
        gap: 16px;
    }

    .chip {
        padding: 12px 28px;
        font-size: 16px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 32px;
        padding: 0 60px;
    }

    .product-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    }

    .product-card:hover .product-img {
        transform: scale(1.05);
    }

    .product-img {
        transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .product-info h3 {
        font-size: 18px;
    }

    #detail-sheet {
        height: 75vh;
        max-height: 700px;
        width: 1000px;
        max-width: 90vw;
        top: 50%;
        left: 50%;
        bottom: auto;
        transform: translate(-50%, -48%) scale(0.98);
        opacity: 0;
        pointer-events: none;
        border-radius: 32px;
        flex-direction: row;
        border: 1px solid rgba(255, 255, 255, 0.5);
    }

    #detail-sheet.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: auto;
    }

    .sheet-hero {
        width: 55%;
        height: 100%;
        background-color: #fafafa;
        padding: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-right: 1px solid var(--gray-light);
    }

    .sheet-hero img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background-color: transparent;
        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.05));
    }

    html[dir="rtl"] .sheet-hero {
        border-right: none;
        border-left: 1px solid var(--gray-light);
    }

    .sheet-content {
        width: 45%;
        padding: 60px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .sheet-title {
        font-size: 32px;
        margin-bottom: 20px;
    }

    .sheet-desc {
        font-size: 16px;
        margin-bottom: 32px;
    }

    .description-links {
        margin-top: 40px;
        padding-top: 32px;
        grid-template-columns: 1fr;
        /* Stack vertically for cleaner desktop look */
        width: 100%;
        max-width: 380px;
        /* Prevent over-stretching */
    }

    #link-loc {
        grid-column: auto;
    }

    .description-links a {
        padding: 14px 20px;
        background: #ffffff;
        border: 1px solid var(--gray-light);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    }

    .description-links a:hover {
        border-color: var(--primary-text);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
        background: #ffffff;
    }

    .description-links a i {
        width: 44px;
        height: 44px;
        font-size: 20px;
        margin-right: 16px;
    }

    html[dir="rtl"] .description-links a i {
        margin-right: 0;
        margin-left: 16px;
    }

    .description-links a span {
        font-size: 15px;
        letter-spacing: 0.2px;
    }

    .handle {
        display: none;
    }
}