/* ============================================================
   My Store — Main CSS
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background: #F9FAFB;
    color: #111827;
    line-height: 1.7;
    font-size: 15px;
}

a { color: #1E40AF; text-decoration: none; }
a:hover { color: #2563EB; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Skip link */
.skip-link {
    position: absolute;
    right: -9999px;
    top: 0;
    background: #1E40AF;
    color: #fff;
    padding: 10px 20px;
    z-index: 9999;
}
.skip-link:focus { right: 10px; top: 10px; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 20px;
}
.site-branding .site-title {
    font-size: 22px;
    font-weight: 800;
    color: #1E40AF;
}
.custom-logo { max-height: 60px; width: auto; }

.main-nav .nav-menu {
    display: flex;
    gap: 24px;
    list-style: none;
}
.main-nav .nav-menu a {
    color: #374151;
    font-weight: 500;
    font-size: 15px;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: .2s;
}
.main-nav .nav-menu a:hover { color: #1E40AF; border-color: #1E40AF; }

.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: #EFF6FF;
    color: #1E40AF;
    border-radius: 12px;
    transition: .2s;
}
.cart-btn:hover { background: #DBEAFE; color: #1E40AF; }
.cart-count {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #F59E0B;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #374151;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    text-decoration: none;
    line-height: 1.2;
}
.btn-primary { background: #1E40AF; color: #fff; }
.btn-primary:hover { background: #1E3A8A; color: #fff; }
.btn-secondary { background: #E5E7EB; color: #111827; }
.btn-secondary:hover { background: #D1D5DB; color: #111827; }
.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-disabled { background: #F3F4F6; color: #9CA3AF; cursor: not-allowed; }

.btn-add-to-cart {
    background: #F59E0B;
    color: #fff;
    width: 100%;
    margin-top: 10px;
}
.btn-add-to-cart:hover { background: #D97706; color: #fff; }
.btn-add-to-cart.added { background: #16A34A; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    padding: 60px 0;
    margin-bottom: 40px;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.hero-text h1 {
    font-size: 40px;
    font-weight: 800;
    color: #1E3A8A;
    margin-bottom: 16px;
    line-height: 1.2;
}
.hero-text p {
    font-size: 17px;
    color: #4B5563;
    margin-bottom: 28px;
}
.hero-img svg { max-width: 100%; height: auto; }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: 40px 0; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-title {
    font-size: 26px;
    font-weight: 800;
    color: #1E3A8A;
}
.link-more {
    color: #1E40AF;
    font-weight: 600;
    font-size: 14px;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.category-card {
    background: #fff;
    padding: 24px 20px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: .2s;
    border: 2px solid transparent;
}
.category-card:hover {
    transform: translateY(-3px);
    border-color: #1E40AF;
    box-shadow: 0 8px 24px rgba(30,64,175,.12);
}
.cat-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1E3A8A;
    margin-bottom: 6px;
}
.cat-count { font-size: 13px; color: #6B7280; }

/* ============================================================
   Products Grid
   ============================================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.product-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: .2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(30,64,175,.12);
}
.product-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    background: #F3F4F6;
}
.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: .3s;
}
.product-card:hover .product-thumb img { transform: scale(1.05); }

.badge-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #DC2626;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.badge-out {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #374151;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.product-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    min-height: 42px;
    line-height: 1.4;
}
.product-title a { color: #111827; }
.product-title a:hover { color: #1E40AF; }

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 6px;
}
.price-now {
    font-size: 18px;
    font-weight: 800;
    color: #1E40AF;
}
.price-old {
    font-size: 13px;
    color: #9CA3AF;
    text-decoration: line-through;
}

/* ============================================================
   Products Page (Archive)
   ============================================================ */
.products-page { padding: 40px 20px; }
.page-header { margin-bottom: 28px; }
.page-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: #1E3A8A;
    margin-bottom: 6px;
}
.page-header p { color: #6B7280; }

.products-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
}
.filters {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    height: fit-content;
    position: sticky;
    top: 100px;
}
.filters h3 {
    font-size: 16px;
    margin-bottom: 14px;
    color: #1E3A8A;
}
.filter-list { list-style: none; }
.filter-list li { margin-bottom: 6px; }
.filter-list a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    transition: .2s;
}
.filter-list a:hover { background: #F3F4F6; }
.filter-list a.active {
    background: #1E40AF;
    color: #fff;
    font-weight: 700;
}
.filter-list .count {
    color: #6B7280;
    font-size: 12px;
    margin-right: 4px;
}
.filter-list a.active .count { color: #DBEAFE; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.pagination .page-numbers {
    padding: 10px 16px;
    background: #fff;
    border-radius: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: #1E40AF;
    color: #fff;
}

/* ============================================================
   Single Product
   ============================================================ */
.product-single { padding: 28px 20px 60px; }

.breadcrumb {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.breadcrumb a { color: #6B7280; }
.breadcrumb a:hover { color: #1E40AF; }

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: #fff;
    padding: 28px;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.product-gallery { display: flex; flex-direction: column; gap: 14px; }
.gallery-main {
    position: relative;
    background: #F3F4F6;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.gallery-thumbs .thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #E5E7EB;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: .2s;
}
.gallery-thumbs .thumb:hover,
.gallery-thumbs .thumb.active { border-color: #1E40AF; }
.gallery-thumbs .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info { display: flex; flex-direction: column; gap: 14px; }
.product-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    background: #EFF6FF;
    color: #1E40AF;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.product-name {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
}
.product-price-big {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.product-price-big .price-now {
    font-size: 30px;
    font-weight: 800;
    color: #1E40AF;
}
.product-price-big .price-old { font-size: 17px; }
.discount-tag {
    background: #FEF2F2;
    color: #DC2626;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}
.product-meta {
    border-top: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
    padding: 14px 0;
    font-size: 14px;
}
.product-meta p { margin-bottom: 6px; }
.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}
.status.in  { background: #D1FAE5; color: #065F46; }
.status.out { background: #FEE2E2; color: #991B1B; }

.product-description {
    font-size: 15px;
    color: #374151;
    line-height: 1.8;
}
.product-description p { margin-bottom: 12px; }

.add-to-cart-box {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.qty-control {
    display: flex;
    align-items: center;
    background: #F3F4F6;
    border-radius: 10px;
    overflow: hidden;
}
.qty-btn {
    width: 44px;
    height: 48px;
    background: transparent;
    border: none;
    font-size: 18px;
    font-weight: 700;
    color: #1E40AF;
    cursor: pointer;
}
.qty-btn:hover { background: #E5E7EB; }
#qty {
    width: 50px;
    height: 48px;
    text-align: center;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
}
.add-to-cart-box .btn-add-to-cart {
    flex: 1;
    width: auto;
    margin-top: 0;
    min-width: 180px;
}

/* ============================================================
   Cart Page
   ============================================================ */
.cart-page { padding: 40px 20px 80px; }

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
}

.cart-empty {
    background: #fff;
    padding: 60px 24px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.cart-empty h2 {
    font-size: 22px;
    color: #1E3A8A;
    margin-bottom: 8px;
}
.cart-empty p {
    color: #6B7280;
    margin-bottom: 24px;
}

.cart-item {
    display: grid;
    grid-template-columns: 90px 1fr auto auto;
    gap: 16px;
    align-items: center;
    background: #fff;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.cart-item-img {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    object-fit: cover;
    background: #F3F4F6;
}
.cart-item-name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}
.cart-item-price {
    font-size: 14px;
    color: #6B7280;
}
.cart-item-qty {
    display: flex;
    align-items: center;
    background: #F3F4F6;
    border-radius: 8px;
    overflow: hidden;
}
.cart-item-qty button {
    width: 36px;
    height: 38px;
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 700;
    color: #1E40AF;
    cursor: pointer;
}
.cart-item-qty button:hover { background: #E5E7EB; }
.cart-item-qty input {
    width: 40px;
    height: 38px;
    text-align: center;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
}
.cart-item-remove {
    background: transparent;
    border: none;
    color: #DC2626;
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
}
.cart-item-remove:hover { background: #FEE2E2; border-radius: 8px; }

.cart-summary {
    background: #fff;
    padding: 24px;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    position: sticky;
    top: 100px;
}
.cart-summary h2 {
    font-size: 20px;
    color: #1E3A8A;
    margin-bottom: 16px;
}
.cart-summary h3 {
    font-size: 16px;
    color: #374151;
    margin-bottom: 12px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}
.total-amount {
    font-size: 20px;
    color: #1E40AF;
}
.cart-summary hr {
    border: none;
    border-top: 1px solid #E5E7EB;
    margin: 18px 0;
}
.form-note {
    text-align: center;
    font-size: 12px;
    color: #6B7280;
    margin-top: 10px;
}

/* ============================================================
   Thanks Page
   ============================================================ */
.thanks-page {
    padding: 60px 20px;
    display: flex;
    justify-content: center;
}
.thanks-card {
    background: #fff;
    padding: 48px 32px;
    border-radius: 22px;
    max-width: 560px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,.08);
}
.thanks-icon {
    font-size: 72px;
    margin-bottom: 12px;
    animation: pop .4s ease;
}
@keyframes pop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.thanks-card h1 {
    font-size: 26px;
    color: #16A34A;
    margin-bottom: 12px;
}
.thanks-msg {
    color: #6B7280;
    margin-bottom: 24px;
}
.ref-box {
    background: #F0FDF4;
    border: 2px dashed #16A34A;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 28px;
}
.ref-box span {
    display: block;
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 6px;
}
.ref-number {
    display: block;
    font-size: 24px;
    color: #065F46;
    font-family: monospace;
    font-weight: 800;
    letter-spacing: 2px;
}
.ref-note {
    font-size: 12px;
    color: #6B7280;
    margin-top: 8px;
}
.thanks-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: #111827;
    color: #D1D5DB;
    padding: 48px 0 0;
    margin-top: 60px;
}
.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    padding-bottom: 32px;
}
.footer-col h3,
.footer-col h4 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 16px;
}
.footer-col p {
    font-size: 14px;
    line-height: 1.8;
}
.footer-col a { color: #D1D5DB; }
.footer-col a:hover { color: #F59E0B; }
.footer-menu { list-style: none; }
.footer-menu li { margin-bottom: 6px; }
.footer-bottom {
    border-top: 1px solid #374151;
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #9CA3AF;
}

/* ============================================================
   No results
   ============================================================ */
.no-results {
    background: #fff;
    padding: 60px 24px;
    border-radius: 14px;
    text-align: center;
    color: #6B7280;
    font-size: 16px;
}

/* ============================================================
   Form rows (عام)
   ============================================================ */
.form-row { margin-bottom: 14px; }
.form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
    font-size: 14px;
}
.form-row input,
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    background: #fff;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: #1E40AF;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
    .products-layout { grid-template-columns: 1fr; }
    .filters { position: static; }
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
}

@media (max-width: 768px) {
    .header-inner { padding: 12px 16px; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: #fff;
        padding: 16px;
        box-shadow: 0 6px 20px rgba(0,0,0,.08);
    }
    .main-nav.open { display: block; }
    .main-nav .nav-menu {
        flex-direction: column;
        gap: 8px;
    }
    .menu-toggle { display: block; }

    .hero { padding: 40px 0; }
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-text h1 { font-size: 28px; }
    .hero-img { display: none; }

    .product-detail { grid-template-columns: 1fr; padding: 16px; }
    .product-name { font-size: 22px; }
    .product-price-big .price-now { font-size: 24px; }

    .cart-item {
        grid-template-columns: 70px 1fr;
        gap: 12px;
    }
    .cart-item-qty { grid-column: 2; justify-self: start; }
    .cart-item-remove { grid-column: 2; justify-self: end; grid-row: 2; }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    .product-title { font-size: 13px; min-height: 36px; }
    .price-now { font-size: 16px; }
    .btn-add-to-cart { font-size: 13px; padding: 10px 12px; }

    .section-title { font-size: 22px; }
    .thanks-card { padding: 32px 20px; }
    .thanks-card h1 { font-size: 22px; }
}