:root {
    --store-font: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    --store-ink: #1a2332;
    --store-text: #3d4a5c;
    --store-muted: #8896a6;
    --store-line: #eceef1;
    --store-bg: #fafbfc;
    --store-card: #ffffff;
    --store-accent: #2c3e50;
    --store-accent-hover: #1a252f;
    --store-price: #1a2332;
    --store-sale: #c0392b;
    --store-badge: #b88a44;
    --store-radius: 14px;
    --store-shadow: 0 1px 8px rgba(0,0,0,0.04);
    --store-shadow-hover: 0 4px 20px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.store-page {
    font-family: var(--store-font);
    background: var(--store-bg);
    color: var(--store-text);
    line-height: 1.6;
}

/* Header */
.store-header {
    background: var(--store-card);
    border-bottom: 1px solid var(--store-line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.store-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.store-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--store-ink);
    text-decoration: none;
    white-space: nowrap;
}

.store-logo i { color: var(--store-accent); }

.store-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.store-search input {
    width: 100%;
    border: 1px solid var(--store-line);
    border-radius: 10px;
    padding: 10px 40px 10px 14px;
    font-size: 14px;
    background: var(--store-bg);
    transition: border-color .2s;
}

.store-search input:focus {
    outline: none;
    border-color: var(--store-accent);
    background: #fff;
}

.store-search button {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--store-muted);
    cursor: pointer;
    padding: 4px 8px;
}

.store-cart-link {
    position: relative;
    color: var(--store-ink);
    text-decoration: none;
    font-size: 1.4rem;
    padding: 8px;
}

.store-login-btn {
    color: var(--store-muted);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid var(--store-line);
    border-radius: 10px;
    transition: color .2s, border-color .2s, background .2s;
    white-space: nowrap;
}

.store-login-btn:hover {
    color: var(--store-ink);
    border-color: var(--store-accent);
    background: var(--store-bg);
}

.store-cart-count {
    position: absolute;
    top: -2px;
    left: -2px;
    background: var(--store-accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Categories bar */
.store-cats-bar {
    background: var(--store-card);
    border-bottom: 1px solid var(--store-line);
}

.store-cats-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.store-cats-inner a {
    color: var(--store-muted);
    text-decoration: none;
    padding: 12px 16px;
    font-size: .9rem;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}

.store-cats-inner a:hover,
.store-cats-inner a.active {
    color: var(--store-ink);
    border-bottom-color: var(--store-accent);
}

/* Layout */
.store-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Hero banner */
.store-hero {
    background: linear-gradient(135deg, #1a2332 0%, #2c3e50 100%);
    border-radius: var(--store-radius);
    padding: 48px 40px;
    margin-bottom: 32px;
    color: #fff;
    text-align: center;
}

.store-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.store-hero p {
    font-size: 1.1rem;
    opacity: .8;
}

/* Section title */
.store-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--store-ink);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-section-title i { color: var(--store-accent); }

/* Product grid */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.store-card {
    background: var(--store-card);
    border: 1px solid var(--store-line);
    border-radius: var(--store-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}

.store-card:hover {
    box-shadow: var(--store-shadow-hover);
    transform: translateY(-2px);
}

.store-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f0f2f5;
}

.store-card-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    color: #c5ccd6;
    font-size: 2.5rem;
}

.store-card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.store-card-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--store-ink);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.store-card-cat {
    font-size: .78rem;
    color: var(--store-muted);
    margin-bottom: 8px;
}

.store-card-price {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.store-card-price .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--store-price);
}

.store-card-price .old-price {
    font-size: .85rem;
    color: var(--store-muted);
    text-decoration: line-through;
}

.store-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--store-sale);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}

.store-card-add {
    margin-top: 10px;
    width: 100%;
    background: var(--store-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.store-card-add:hover { background: var(--store-accent-hover); }

.store-card-add:disabled {
    background: #e4e7eb;
    color: #9aa5b1;
    cursor: not-allowed;
}

.store-card-wrapper {
    position: relative;
}

/* Product details */
.store-product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    background: var(--store-card);
    border: 1px solid var(--store-line);
    border-radius: var(--store-radius);
    padding: 24px;
}

.store-product-img {
    width: 100%;
    border-radius: 10px;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f0f2f5;
}

.store-product-info h1 {
    font-size: 1.5rem;
    color: var(--store-ink);
    margin-bottom: 8px;
}

.store-product-info .category-tag {
    color: var(--store-muted);
    font-size: .9rem;
    margin-bottom: 16px;
}

.store-product-info .desc {
    color: var(--store-text);
    margin-bottom: 20px;
    line-height: 1.7;
}

.store-product-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
}

.store-product-price .price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--store-price);
}

.store-product-price .old-price {
    font-size: 1.1rem;
    color: var(--store-muted);
    text-decoration: line-through;
}

.store-qty-selector {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
}

.store-qty-selector button {
    width: 40px;
    height: 44px;
    border: 1px solid var(--store-line);
    background: var(--store-bg);
    color: var(--store-ink);
    font-size: 1.1rem;
    cursor: pointer;
}

.store-qty-selector button:first-child { border-radius: 10px 0 0 10px; }
.store-qty-selector button:last-child { border-radius: 0 10px 10px 0; }

.store-qty-selector input {
    width: 60px;
    height: 44px;
    text-align: center;
    border: 1px solid var(--store-line);
    border-right: none;
    border-left: none;
    font-size: 1rem;
}

.store-add-cart-btn {
    background: var(--store-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.store-add-cart-btn:hover { background: var(--store-accent-hover); }

/* Cart */
.store-cart-page {
    background: var(--store-card);
    border: 1px solid var(--store-line);
    border-radius: var(--store-radius);
    padding: 24px;
}

.store-cart-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--store-line);
    align-items: center;
}

.store-cart-item:last-child { border-bottom: none; }

.store-cart-item img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    background: #f0f2f5;
}

.store-cart-item .info { flex: 1; }

.store-cart-item .info h6 {
    font-size: .95rem;
    color: var(--store-ink);
    margin-bottom: 4px;
}

.store-cart-item .info .price {
    font-weight: 700;
    color: var(--store-price);
}

.store-cart-item .qty-mini {
    display: flex;
    align-items: center;
    gap: 0;
}

.store-cart-item .qty-mini button {
    width: 32px;
    height: 36px;
    border: 1px solid var(--store-line);
    background: var(--store-bg);
    cursor: pointer;
    font-size: .9rem;
}

.store-cart-item .qty-mini button:first-child { border-radius: 8px 0 0 8px; }
.store-cart-item .qty-mini button:last-child { border-radius: 0 8px 8px 0; }

.store-cart-item .qty-mini span {
    width: 44px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--store-line);
    border-bottom: 1px solid var(--store-line);
    font-weight: 600;
}

.store-cart-item .remove-btn {
    color: var(--store-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
}

.store-cart-item .remove-btn:hover { color: var(--store-sale); }

.store-cart-summary {
    background: var(--store-bg);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.store-cart-summary .row-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: var(--store-text);
}

.store-cart-summary .row-line.total {
    border-top: 1px solid var(--store-line);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--store-ink);
}

/* Checkout form */
.store-checkout-page {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

.store-checkout-form {
    background: var(--store-card);
    border: 1px solid var(--store-line);
    border-radius: var(--store-radius);
    padding: 24px;
}

.store-checkout-form .form-control,
.store-checkout-form .form-select {
    border: 1px solid var(--store-line);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
}

.store-checkout-form .form-control:focus,
.store-checkout-form .form-select:focus {
    border-color: var(--store-accent);
    box-shadow: 0 0 0 .2rem rgba(44,62,80,.08);
}

.store-checkout-sidebar {
    background: var(--store-card);
    border: 1px solid var(--store-line);
    border-radius: var(--store-radius);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.store-checkout-sidebar .place-order-btn {
    width: 100%;
    background: var(--store-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.store-checkout-sidebar .place-order-btn:hover { background: var(--store-accent-hover); }
.store-checkout-sidebar .place-order-btn:disabled { background: #e4e7eb; color: #9aa5b1; cursor: not-allowed; }

/* Success page */
.store-success {
    text-align: center;
    background: var(--store-card);
    border: 1px solid var(--store-line);
    border-radius: var(--store-radius);
    padding: 60px 40px;
    max-width: 500px;
    margin: 40px auto;
}

.store-success .icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2e7d32;
    font-size: 2rem;
}

.store-success h2 {
    color: var(--store-ink);
    margin-bottom: 8px;
}

.store-success p { color: var(--store-muted); margin-bottom: 24px; }

.store-success .order-info {
    background: var(--store-bg);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}

.store-success .order-info .label { color: var(--store-muted); font-size: .85rem; }
.store-success .order-info .value { font-weight: 700; color: var(--store-ink); font-size: 1.2rem; }

/* Closed page */
.store-closed {
    text-align: center;
    padding: 80px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.store-closed .icon {
    font-size: 3rem;
    color: var(--store-muted);
    margin-bottom: 20px;
}

.store-closed h2 { color: var(--store-ink); margin-bottom: 8px; }
.store-closed p { color: var(--store-muted); }

/* Footer */
.store-footer {
    background: var(--store-card);
    border-top: 1px solid var(--store-line);
    margin-top: 40px;
    padding: 24px 20px;
    text-align: center;
    color: var(--store-muted);
    font-size: .85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .store-product-detail {
        grid-template-columns: 1fr;
    }
    .store-checkout-page {
        grid-template-columns: 1fr;
    }
    .store-checkout-sidebar {
        position: static;
    }
    .store-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    .store-header-inner {
        flex-wrap: wrap;
        gap: 10px;
    }
    .store-search {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    .store-hero {
        padding: 32px 20px;
    }
    .store-hero h1 { font-size: 1.5rem; }
    .store-hero p { font-size: .95rem; }
}

/* Toast */
.store-toast {
    position: fixed;
    bottom: 20px;
    right: 50%;
    transform: translateX(50%);
    background: var(--store-ink);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: .9rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

.store-toast.show { opacity: 1; }
