/* =========================================
   1. IMPORTS & VARIABLES
========================================= */
@font-face {
    font-family: 'YekanBakh';
    src: url('../yekan-bakh.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Color Palette */
    --gold: #d4af37;
    --gold-hover: #b8962c;
    --dark: #000;
    --light: #fff;
    --white: #ffffff;
    --border: #eaeaea;
    --text-muted: #555555;
    --danger: #dc3545;

    /* Shadows & Transitions */
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.05);
    --transition: all 0.1s ease;
    
    /* Typography */
    --font-family: 'YekanBakh', sans-serif;
}

/* =========================================
   GLOBAL SCROLLBAR (50% Transparent)
========================================= */
/* Firefox */
html {
    /* Using the 50% transparent hex code for Firefox */
    scrollbar-color: #d4af3780 #f1f1f1;
    scrollbar-width: thin; 
}

/* WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px; 
}

::-webkit-scrollbar-track {
    background: #f1f1f1; 
}

::-webkit-scrollbar-thumb {
    /* 50% transparent gold */
    background: #d4af3780; 
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    /* Returns to solid 100% gold on hover */
    background: var(--gold); 
}
/* =========================================
   2. BASE & RESET
========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    /*! background-color: #f4f4f4; */
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background: #ffffff;
    background: linear-gradient(162deg,rgba(255, 255, 255, 1) 0%, rgba(245, 245, 245, 1) 100%);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   3. GLOBAL COMPONENTS
========================================= */
header {
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
   /* max-width: 1600px;*/
    width: 100%;
    margin: 0 auto;
}

.logo {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--dark);
    width: 120px;
}

.nav-icons {
    margin-top: 10px;
    margin-left: 15px;
}

.nav-icons a {
    font-size: 1.2rem;
    position: relative;
    margin-right: 1.5rem;
}

.nav-icons a:hover {
    color: var(--gold);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--gold);
    color: var(--white);
    font-size: 0.75rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.breadcrumb {
    padding: 1.5rem 5%;
    font-size: 1rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--dark);
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--gold);
}

.success-msg {
    background: #d1e7dd;
    color: #0f5132;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #badbcc;
}

/* Base Buttons */
.btn-primary, 
.btn-submit, 
.btn-checkout, 
.btn-add {
    display: inline-block;
    background: var(--dark);
    color: var(--white);
    border: none;
    padding: 1rem 3rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary:hover, 
.btn-submit:hover, 
.btn-checkout:hover, 
.btn-add:hover {
    background: var(--gold);
}

/* Global Loading SVG & Fade-in Media Styles */
.media-placeholder {
    background-image: url('../loading.svg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 40px;
    background-color: #f8f8f8;
    position: relative;
    overflow: hidden;
}

.fade-media {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.fade-media.loaded {
    opacity: 1;
}

/* =========================================
   4. STOREFRONT (index.php)
========================================= */
.hero {
    height: 100px;
}

.herotext {
    padding: 1rem 20px;
}

.herotext h1 {
    font-weight: 300;
    font-size: 1.5rem;
    color: var(--dark);
}
.herotext p {

}

.heroimg {
    background-image: url('../hero-ln.jpg');
    background-size: cover;
    background-position: right;
    background-repeat: no-repeat;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #000;
    background-color: #fff;
    max-width: 100vw;
    display: block;
    margin: auto;
    mix-blend-mode: multiply;
}

.heroimg::before{
mix-blend-mode: multiply;
}

.hero h1 {
    font-weight: 300;
    font-size: 2.1rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    right: 10%;
    position: absolute;
}

.hero p {
    color: var(--dark);
    margin-bottom: 0.5rem;
    margin-right: 0.5rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
}

.category-card {
    position: relative;
    overflow: hidden;
    display: block;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: #000;
}

.category-card .media-placeholder{
    aspect-ratio: 1 / 1;
    height: 100% !important;
    width: 100% !important;
}


.category-card:hover {
       /*! transform: translateY(-5px); */
    box-shadow: var(--shadow-md);
       filter: grayscale(10%)contrast(110%) saturate(111%);
}

.category-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    opacity: 0.8;
    transition: var(--transition);
    display: block;
}

.category-title {
    position: absolute;
    top: 85%;
    right: 22%;
    transform: translate(50%, -50%);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    z-index: 2;
    pointer-events: none;
    width: 100%;
    text-align: center;
}j

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 5% 4rem;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 360px;
}

.product-card:hover {
  /*  transform: translateY(-5px); */
    box-shadow: var(--shadow-md);
}

.product-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.03);
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

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

.btn-add {
    width: 100%;
    padding: 0.8rem 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .heroimg {
        background-image: url('../hero-port.jpg');
        /*! max-height: 520px; */
        background-size: cover;
        background-position: right;
    }
}
@media (min-width: 1400px) {
    .heroimg {
        background-image: url('../hero-ln-max.jpg?v2');
        min-height: 560px;
        background-size: cover;
        background-position: right;
        mix-blend-mode: multiply;
    }
        .heroimg::before {
        mix-blend-mode: screen;
    }
}
/* =========================================
   5. SINGLE PRODUCT 
========================================= */
.product-single-container {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 5%;
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
}

.product-gallery {
    flex: 1;
    min-width: 300px;
}

.main-media-container {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    background: #fff;
    height: 50vh;
    max-width: 500px;
    margin: auto;
}

.main-media-container img, 
.main-media-container video {
    width: 100%;
    display: block;
    object-fit: cover;
}

.thumbnail-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    justify-content: center;
    padding-top: 10px;
}

.thumbnail-grid .media-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

.thumbnail-grid .media-placeholder:hover {
    border-color: var(--gold);
}

.product-details {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.product-details h1 {
    font-weight: 600;
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.product-price-large {
    font-size: 1.8rem;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 2rem;
}

.product-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.meta-item {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.meta-item i {
    color: var(--gold);
    margin-left: 0.5rem;
}

.product-description {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 2rem;
    
    /* Scroll box dimensions */
    max-height: 240px;
    overflow-y: auto;
    
    /* Force scrollbar to the left side */
    direction: rtl; 
    text-align: right; 
    
    /* Padding to prevent text from touching the scrollbar */
    padding-left: 12px;
    padding-right: 12px;

    /* Scrollbar styling for Firefox */
    scrollbar-color: var(--gold) #f1f1f1;
    scrollbar-width: thin;
}

/* Scrollbar styling for WebKit (Chrome, Safari, Edge, iOS, Android) */
.product-description::-webkit-scrollbar {
    width: 6px;
}

.product-description::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 4px;
}

.product-description::-webkit-scrollbar-thumb {
    background: var(--gold); /* Solid gold color */
    border-radius: 4px;
}

.product-description::-webkit-scrollbar-thumb:hover {
    background: var(--gold-hover); /* Slightly darker gold on hover */
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.specs-table th, 
.specs-table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border);
    text-align: right;
}

.specs-table th {
    width: 40%;
    color: var(--text-muted);
    font-weight: normal;
    background: #fafafa;
}

.specs-table td {
    font-weight: 500;
    color: var(--dark);
    background: #f6f6f6;
}

/* =========================================
   6. SHOPPING CART (cart.php)
========================================= */
.container {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.container > h2 {
    font-weight: 300;
    margin-bottom: 2rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.cart-table th, 
.cart-table td {
    padding: 1.5rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.cart-table th {
    font-weight: 500;
    color: var(--text-muted);
}

.cart-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    vertical-align: middle;
    margin-left: 1rem;
    border-radius: 4px;
}

.remove-btn {
    color: var(--danger);
    font-size: 1.2rem;
}

.remove-btn:hover {
    opacity: 0.7;
}

.cart-summary {
    background: var(--white);
    padding: 2rem;
    margin-top: 2rem;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.cart-summary h3 {
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.empty-cart {
    text-align: center;
    padding: 4rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-top: 2rem;
    border-radius: 8px;
}

.empty-cart i {
    font-size: 4rem;
    color: var(--border);
    margin-bottom: 1rem;
}

.empty-cart h3 {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.btn-continue {
    display: inline-block;
    background: var(--dark);
    color: #fff;
    padding: 1rem 3rem;
    text-decoration: none;
    transition: 0.3s;
    font-family: inherit;
}

.btn-continue:hover {
    background: var(--gold);
}

/* =========================================
   7. CHECKOUT PAGE (checkout.php)
========================================= */
.checkout-wrapper {
    max-width: 600px;
    margin: 4rem auto;
    background: var(--white);
    padding: 3rem;
    box-shadow: var(--shadow-md);
}

.checkout-wrapper h2 {
    text-align: center;
    font-weight: 300;
    color: var(--gold);
    margin-bottom: 2rem;
}

.checkout-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 5%;
    align-items: flex-start;
}

.checkout-form-section {
    flex: 2;
    min-width: 300px;
    background: #fff;
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.checkout-summary-section {
    flex: 1;
    min-width: 300px;
    background: var(--bg-color, #f8f9fa);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    position: sticky;
    top: 100px;
}

.section-title {
    font-weight: 400;
    color: var(--gold);
    margin-top: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-group {
    margin-bottom: 1.5rem;
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: 0.3s;
    background: var(--light);
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
    background: #fff;
}

.summary-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border);
    gap: 1rem;
}

.summary-item:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-item-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.summary-item-thumb img, 
.summary-item-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.summary-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-item-title {
    font-size: 0.95rem;
    color: var(--dark);
}

.summary-item-qty {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.summary-item-price {
    font-weight: 500;
    color: var(--gold);
    font-size: 0.95rem;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.btn-submit {
    width: 100%;
    background: var(--dark);
    color: #fff;
    border: none;
    padding: 1.2rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 1.5rem;
    border-radius: 4px;
    font-family: inherit;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--gold);
}

@media (max-width: 768px) {
    .cart-table th, 
    .cart-table td {
        padding: 1rem 0.5rem;
    }
    
    .checkout-wrapper {
        padding: 2rem 1.5rem;
        margin: 2rem 1rem;
    }
}

.product-grid {
  padding: 10px 30px;
 display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}


footer{
    background: #fff; 
    border-top: 1px solid var(--border); 
    padding: 2.5rem 5%; 
    text-align: center; 
    margin-top: 4rem; 
    color: var(--text-muted); 
    font-size: 0.6rem;
}

/* =========================================
   MOBILE RESPONSIVENESS: 2 PRODUCTS PER ROW
========================================= */
@media (max-width: 576px) {
    /* Force 2 columns on small screens */
    .product-grid {
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 2px !important;
      padding: 10px 5px !important;
    }

    /* Reduce the image height so they aren't overly tall */
    /* !important is used to override the inline height: 300px in index.php */
    .product-card .media-placeholder,
    .product-image {
        height: 160px !important; 
    }

    /* Reduce padding and font sizes inside the card to fit the smaller width */
    .product-info {
        padding: 0.8rem;
    }

    .product-title {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .product-price {
        font-size: 0.95rem;
    }

    /* Adjust the "Add" button for smaller columns */
    .btn-add {
        padding: 0.5rem 0.2rem;
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }
}

.product-single-container { max-width: 1200px; margin: 2rem auto; padding: 0 5%; display: flex; flex-wrap: wrap; gap: 4rem; }
.product-gallery { flex: 1; min-width: 300px; }
.main-media-container { width: 100%; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 1rem; background: #fff;}
.main-media-container img, .main-media-container video { width: 100%; display: block; object-fit: cover; }
.thumbnail-grid { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.thumbnail-grid .media-placeholder { width: 80px; height: 80px; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; transition: 0.2s; flex-shrink: 0; position: relative; }
.thumbnail-grid .media-placeholder:hover { border-color: var(--gold); }
.video-thumb-wrapper { position: relative; cursor: pointer; }
.play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    pointer-events: none;
    border-radius: 4px;
}
/* Product ID Badge Styles */
.product-id-badge {
    display: block;
    color: #d2bf85;
    font-size: 0.8rem;
    border-radius: 4px;
    font-family: monospace;
    vertical-align: middle;
    padding: 10px;
    text-align: left;
}
/* Modal Styles */
.cart-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeInOverlay 0.3s ease-out;
}
.cart-modal-box {
    background: #fff; 
    border: 1px solid #000; 
    color: #3a3a3a;
    padding: 1rem;
    border-radius: 25px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    animation: scaleInModal 0.3s ease-out;
    position: relative;
}
.cart-modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #000;
}
.cart-modal-text {
    font-size: 1rem;
    /*! font-weight: 600; */
    margin-bottom: 1.5rem;
}
.cart-modal-actions {
    display: flex;
    justify-content: center;
}
.cart-modal-btn {
    background: #000;
    color: #fff !important;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    font-size: 1rem;
}
.cart-modal-btn:hover {
    background: #333;
}
.cart-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #000;
    opacity: 0.7;
    transition: 0.2s;
}
.cart-modal-close:hover {
    opacity: 1;
}
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleInModal {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Fallback message style for non-js redirect */
.fallback-success-msg {
    background: var(--gold);
    color: #000;
    border: 2px solid #000;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}


.media-placeholder {
background-image: url('loading.svg');
background-position: center center;
background-repeat: no-repeat;
background-size: 40px;
background-color: #f8f8f8;
position: relative;
overflow: hidden;

}
.fade-media {
opacity: 0;
transition: opacity 0.5s ease-in-out;
width: 100%;
height: 100%;
display: block;
object-fit: cover;
}
.fade-media.loaded {
opacity: 1;
}

