/* ==========================================================================
   1. BASE STYLES & UTILITIES (FOR PRODUCT-DETAIL.HTML ONLY)
   ========================================================================== */

:root {
    --primary-color: #b78d65; /* Gold/Bronze */
    --secondary-color: #222; /* Dark Grey/Black */
    --light-bg: #f9f6f2; /* Creamy light background */
    --text-color: #333;
    --light-text: #f0f0f0;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;

    /* Corrected RGB values for transparent colors */
    --primary-color-rgb-r: 183;
    --primary-color-rgb-g: 141;
    --primary-color-rgb-b: 101;
}

/* Universal Box-Sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body and Global Typography */
body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--light-bg);
    overflow-x: hidden; /* Prevent horizontal scroll due to animations or overflow */
    padding-top: 80px; /* Space for fixed navbar */
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Global Container for Content Width */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Global Button Style */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    letter-spacing: 1px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(var(--primary-color-rgb-r), var(--primary-color-rgb-g), var(--primary-color-rgb-b), 0.2);
    text-decoration: none;
    font-weight: 600;
}

.btn:hover {
    background: #a57a50; /* Darker primary */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb-r), var(--primary-color-rgb-g), var(--primary-color-rgb-b), 0.3);
}

.btn-small {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
}

/* Utility Class for hidden elements (for JS toggle) */
.hidden {
    display: none !important;
}

/* Section Header (used in related products and reviews) */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 36px;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.section-header p {
    color: #777;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Product Card (used in related products) */
.product-grid { /* Applies to related products grid */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.product-card {
    position: relative;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 320px;
    object-fit: cover; /* Ensures images fill the card area consistently */
}

.product-card h3 {
    margin: 18px 15px 5px;
    padding: 0;
    font-size: 20px;
    color: var(--secondary-color);
}

.product-card .price {
    padding: 0 15px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
    text-align: left;
}

.product-card .old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 1rem;
    margin-left: 8px;
}

.product-card .add-to-cart {
    width: calc(100% - 30px);
    padding: 12px;
    background: var(--secondary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    margin: 0 15px 15px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
}

.product-card .add-to-cart:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* Product Badges (used in related products) */
.bestseller-badge, .new-arrival-badge, .expert-badge, .limited-badge, .artisan-note {
    position: absolute;
    top: 15px;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 10;
    color: white;
}

.bestseller-badge {
    left: 15px;
    background: var(--primary-color);
}
.new-arrival-badge {
    left: 15px;
    background: #4CAF50; /* Green */
}
.expert-badge {
    left: 15px;
    background: #222;
}
.limited-badge {
    right: 15px;
    background: #d10000; /* Red */
}
.artisan-note {
    left: 15px;
    background: rgba(0,0,0,0.7);
    text-transform: none;
}

/* --- Toast Notification (Global Component) --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-message {
    background-color: var(--secondary-color);
    color: var(--light-text);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    animation: fadeInOut 3s forwards;
    opacity: 0; /* Start hidden for animation */
}

.toast-message i {
    color: #4CAF50; /* Green checkmark */
    font-size: 1.2rem;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* --- Back to Top Button (Global Component) --- */
#backToTopBtn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.3s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

#backToTopBtn:hover {
    background-color: #a57a50;
    transform: translateY(-3px);
    opacity: 1;
}

/* --- Exit Popup (Global Component) --- */
.exit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.exit-popup.show {
    visibility: visible;
    opacity: 1;
}

.popup-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    max-width: 500px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
}

.exit-popup.show .popup-content {
    transform: translateY(0);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.popup-close:hover {
    color: var(--primary-color);
}

.popup-content h3 {
    font-family: var(--font-heading);
    font-size: 30px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.popup-content p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 25px;
}

.popup-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popup-newsletter-form input[type="email"] {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
}

.popup-cta {
    background: var(--secondary-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s ease;
}

.popup-cta:hover {
    background: var(--primary-color);
}

/* --- Search Overlay/Modal (Global Component) --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align closer to top */
    padding-top: 100px; /* Space for nav */
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.search-overlay.active {
    visibility: visible;
    opacity: 1;
}

.search-box {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px 20px;
}

.search-box input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 1.5rem;
    padding: 10px 0;
    font-family: var(--font-body);
    color: var(--text-color);
}

.search-box input::placeholder {
    color: #bbb;
}

.search-box .fas.fa-search {
    font-size: 1.5rem;
    color: #999;
    margin-right: 10px;
}

.search-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.search-close-btn:hover {
    color: var(--primary-color);
}


/* ==========================================================================
   2. LAYOUT & GLOBAL COMPONENTS (FOR PRODUCT-DETAIL.HTML ONLY)
   ========================================================================== */

/* --- Navbar (Specific to product-detail.html's needs) --- */
.luxury-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--secondary-color);
    position: relative;
    background: linear-gradient(90deg, var(--primary-color), #e0c9b1, var(--primary-color));
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    text-decoration: none;
}

@keyframes shine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.main-nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    position: relative;
    text-decoration: none;
    padding: 10px 0;
    overflow: hidden;
}

.nav-text {
    position: relative;
    color: #555;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.nav-hover {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover .nav-text,
.nav-link.active .nav-text {
    color: var(--primary-color);
}

.nav-link:hover .nav-hover {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-actions {
    display: flex;
    gap: 25px;
    align-items: center;
}

.search-icon, 
.cart-icon {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    color: #555;
}

.nav-actions i {
    font-size: 20px;
}

.search-icon:hover i, 
.cart-icon:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.cart-icon {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.cart-count {
    font-size: 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    transform: translateY(-5px);
}

.menu-toggle {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--secondary-color);
    transition: all 0.3s ease-in-out;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --- Footer (Specific to product-detail.html's needs) --- */
.luxury-footer {
    background: var(--secondary-color);
    color: var(--light-text);
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.footer-column h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.footer-column p {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #ccc;
}

.footer-column.about-us .social-icons a {
    color: var(--light-text);
    font-size: 20px;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.footer-column.about-us .social-icons a:hover {
    color: var(--primary-color);
}

.footer-column.links ul {
    list-style: none;
}

.footer-column.links ul li {
    margin-bottom: 10px;
}

.footer-column.links ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column.links ul li a:hover {
    color: var(--primary-color);
}

.newsletter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #444;
    border-radius: 5px;
    background: #333;
    color: white;
    font-family: var(--font-body);
}

.newsletter-form input[type="email"]::placeholder {
    color: #888;
}

.newsletter-form button {
    padding: 12px 25px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.newsletter-form button:hover {
    background: #a57a50;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 40px;
    border-top: 1px solid #333;
    color: #888;
}


/* ==========================================================================
   3. PRODUCT DETAIL PAGE SPECIFIC STYLES (Desktop-First)
   ========================================================================== */

.product-detail-page {
    padding: 80px 0; /* Adjust for fixed header */
    background-color: white;
}

.back-to-shop {
    text-align: left;
    margin-bottom: 30px; /* Space below the back button */
    padding-left: 5%; /* Align with container padding */
}

.back-to-shop .back-btn {
    background: #f0f0f0; /* Lighter background */
    color: var(--secondary-color); /* Dark text */
    border: 1px solid #ddd;
    padding: 0.7rem 1.5rem; /* Smaller padding for a subtle look */
    font-size: 0.9rem;
    box-shadow: none; /* Remove heavy shadow */
}

.back-to-shop .back-btn:hover {
    background: #e5e5e5;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-to-shop .back-btn i {
    margin-right: 8px; /* Space between icon and text */
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns: image on left, info on right (default for large screens) */
    gap: 60px;
    padding: 0 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.product-images {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#main-product-image {
    width: 100%;
    height: 550px; /* Fixed height for desktop to ensure consistent visual area */
    object-fit: contain; /* Ensures entire image is visible without cropping */
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.thumbnail-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    justify-content: flex-start; /* Ensure thumbnails align to start */
    padding-left: 5%; /* Align with overall container padding */
    padding-right: 5%; /* Ensure space on the right for scrolling */
    box-sizing: border-box;
}
.thumbnail-gallery img {
    flex-shrink: 0; /* Prevent shrinking */
    width: 90px;
    height: 90px;
    object-fit: cover; /* Cover thumbnail area to ensure consistency */
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s, transform 0.2s;
}

.thumbnail-gallery img:hover {
    transform: translateY(-3px);
}

.thumbnail-gallery img.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color); /* Add a secondary shadow for emphasis */
}

.product-info-details {
    padding-top: 20px; /* Align with image a bit better */
}

.product-info-details h1 {
    font-size: 3.2rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.product-price {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.product-price #old-price {
    font-size: 1.5rem;
    color: #999;
    text-decoration: line-through;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FFC107; /* Star color */
    margin-bottom: 20px;
}

.product-rating .stars-display i {
    font-size: 1.2rem;
    margin-right: 2px;
}

.product-rating span {
    font-size: 1rem;
    color: #777;
}

.product-rating span span { /* For average rating and count */
    font-weight: 600;
    color: var(--text-color);
}


.product-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 30px;
}

.product-meta {
    margin-top: 30px;
    margin-bottom: 40px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 25px 0;
}

.product-meta h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.product-meta ul {
    list-style: none;
    padding: 0;
}

.product-meta ul li {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #666;
}

.product-meta ul li strong {
    color: var(--text-color);
    font-weight: 600;
    margin-right: 5px;
}

.add-to-cart-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

/* Quantity Selector (General/Desktop) */
.quantity-selector {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0; /* Prevent shrinking of the whole control */
    line-height: 0; /* Crucial for removing tiny gaps between flex items */
}

.quantity-selector button {
    background: #f0f0f0;
    border: none; /* Ensure no individual button borders */
    padding: 10px 15px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0; /* Ensure buttons don't shrink */
    height: 40px; /* Explicit height for consistent alignment */
    display: flex; /* Use flex to perfectly center content */
    align-items: center;
    justify-content: center;
}

.quantity-selector button:hover {
    background: #e0e0e0;
}

.quantity-selector input {
    width: 60px; /* Default width for desktop */
    text-align: center;
    border: none; /* Ensure no individual input borders */
    font-size: 1.1rem;
    flex-grow: 1;
    min-width: 40px;
 
    margin: 0; /* Remove any default margin */
    padding: 0; /* Remove any default padding */
    height: 40px; /* Explicit height to match buttons */
    line-height: 40px; /* Crucial for vertical text centering */
    background: transparent; /* Ensure no background conflicts */
    outline: none; /* Remove focus outline that might look like a gap */
    vertical-align: middle; /* Helps with alignment in some contexts */
}

.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Chrome, Safari, Edge spinner removal */
    margin: 0;
}

.add-to-cart-detail-page { /* Specific style for this button */
    flex-grow: 1; /* Take remaining space */
    max-width: 300px;
    font-size: 1.2rem;
}

.buy-now-detail-page {
    background: var(--primary-color); /* Use primary color for Buy Now */
    color: white;
    flex-grow: 1; /* Take remaining space */
    max-width: 300px; /* Match add to cart button max-width */
    font-size: 1.2rem;
}

.buy-now-detail-page:hover {
    background: #a57a50; /* Darker primary on hover */
}

/* --- Reviews Section (General/Desktop) --- */
.product-reviews {
    padding: 60px 0;
    background-color: var(--light-bg);
}

#reviews-list {
    margin-top: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.review-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #777;
}

.reviewer-name {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Stars displayed in individual review items */
.review-item .review-rating {
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: flex; /* Ensure stars are in a row */
    align-items: center;
}

.review-item .review-rating i {
    margin-right: 2px;
}

.review-comment {
    line-height: 1.6;
    color: #555;
}

.review-form-container {
    background: #ffffff; /* Pure white background */
    border-radius: 12px; /* More pronounced rounded corners */
    padding: 40px; /* Increased padding for more breathing room */
    margin-top: 50px; /* More space from previous section */
    box-shadow: 0 8px 30px rgba(0,0,0,0.1); /* Stronger, softer shadow */
    border: 1px solid #f0f0f0; /* Subtle light border */
}

.review-form-container h3 {
    font-family: var(--font-heading);
    font-size: 28px; /* Slightly larger heading */
    color: var(--secondary-color);
    margin-bottom: 25px; /* More space below heading */
    text-align: center;
    letter-spacing: 0.5px;
}
.review-form .form-group {
    margin-bottom: 20px;
}

.review-form label {
    display: block;
    margin-bottom: 10px; /* Increased space below label */
    font-weight: 600;
    color: var(--secondary-color); /* Darker color for labels */
    font-size: 1.05rem; /* Slightly larger font */
}

.review-form input[type="text"],
.review-form textarea {
    width: 100%;
    padding: 14px 18px; /* More generous padding */
    border: 1px solid #e0e0e0; /* Lighter, subtle border */
    border-radius: 8px; /* More rounded corners */
    font-family: var(--font-body);
    font-size: 1.05rem; /* Slightly larger text */
    color: var(--text-color);
    background-color: #fcfcfc; /* Very light background */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    resize: vertical; /* Keep vertical resize */
    outline: none; /* Remove default outline */
}

.review-form input[type="text"]:focus,
.review-form textarea:focus {
    border-color: var(--primary-color); /* Highlight border on focus */
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb-r), var(--primary-color-rgb-g), var(--primary-color-rgb-b), 0.2); /* Soft glow on focus */
}

/* Base style for the interactive star rating in the review form */
.star-rating {
    display: flex;
    gap: 8px; /* More space between stars */
    font-size: 1.8rem; /* Larger stars */
    cursor: pointer;
    justify-content: center; /* Center stars in the form */
    margin-bottom: 20px; /* More space below stars */
}

/* Default color for outline stars (far.fa-star) across all star displays */
.product-rating .stars .far.fa-star,
.review-item .review-rating .far.fa-star,
.star-rating .far.fa-star {
    color: #999; /* Slightly darker grey for better visibility */
    text-shadow: 0 0 1px rgba(0,0,0,0.1); /* Subtle shadow for definition */
}

/* Color for filled stars (fas.fa-star) across all star displays */
.product-rating .stars .fas.fa-star,
.review-item .review-rating .fas.fa-star,
.star-rating .fas.fa-star {
    color: #FFD700; /* Gold color for filled stars */
    text-shadow: 0 0 5px rgba(255,215,0,0.5); /* A subtle glow */
}

/* Hover effect for review form stars (when selecting) */
#review-star-rating span:hover .fas.fa-star,
#review-star-rating span:hover .far.fa-star,
#review-star-rating span:hover ~ span .fas.fa-star {
    color: #FFD700;
    text-shadow: 0 0 5px rgba(255,215,0,0.5);
}

#review-star-rating span:hover ~ span .far.fa-star {
    color: #999;
    text-shadow: 0 0 1px rgba(0,0,0,0.1);
}


/* ==========================================================================
   4. RESPONSIVE STYLES (ALL MEDIA QUERIES FOR PRODUCT-DETAIL.HTML)
   ========================================================================== */

/* --- Tablets and small laptops (max-width: 992px) --- */
@media (max-width: 992px) {
    /* Navbar */
    .nav-container {
        padding: 0 4%;
    }
    .main-nav {
        gap: 10px;
    }
    .nav-text {
        font-size: 13px;
    }

    /* Product Detail Page adjustments */
    .product-detail-grid {
        gap: 40px;
    }
    .product-info-details h1 {
        font-size: 2.8rem;
    }
    .product-price {
        font-size: 1.8rem;
    }

    /* Related Products Grid */
    .product-grid { /* This applies to #related-products .product-grid */
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
}

/* --- Mobile Devices (max-width: 768px) --- */
@media (max-width: 768px) {
    /* Base Body Padding */
    body {
        padding-top: 70px; /* Adjust for smaller fixed header */
    }

    /* Navbar adjustments */
    .nav-container {
        height: 70px;
        padding: 0 3%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
/* NEW: Group nav-actions and menu-toggle on mobile */
    .nav-actions-and-toggle {
        display: flex;
        align-items: center;
        gap: 15px; /* Space between icons and hamburger */
        order: 3; /* Ensure this group comes after logo and main-nav (which is order 2) */
    }
    /* Ensure main-nav is hidden and doesn't take space */
    .main-nav {
        display: none; /* Hide main nav links on mobile */
        flex-grow: 0;
        flex-shrink: 0;
        order: 2; /* Keep its order in the flow even when hidden */
    }
    /* Ensure hamburger is shown */
    .menu-toggle {
        display: flex !important; /* Force display flex for hamburger */
        /* No order needed here, as it's inside nav-actions-and-toggle */
    }
    /* The logo (order 1) and nav-actions (inside order 3) don't need explicit order here */
    .logo {
        font-size: 24px;
    }
    .main-nav { /* Mobile menu overlay */
        display: none; /* Hidden by default */
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 5px 30px rgba(0, 0, 0, 0.05);
        border-top: 1px solid rgba(0,0,0,0.03);
        padding: 20px 0;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    }
    .main-nav.active {
        display: flex; /* Show when active */
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .nav-link {
        width: 80%;
        text-align: center;
        padding: 12px 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    .nav-link:last-child {
        border-bottom: none;
    }
    .nav-text {
        font-size: 16px;
    }
    .nav-actions {
        gap: 15px;
    }
    .nav-actions i {
        font-size: 18px;
    }

    /* --- Product Detail Page Mobile Improvements --- */
    .product-detail-grid {
            padding: 0 1% !important; /* Even smaller padding for extreme small screens */
            gap: 10px !important; /* Even smaller gap */
            min-width: 0 !important; /* CRUCIAL: Reiterate for smallest screens */
        }

    .product-images,
    .product-info-details {
        min-width: 0 !important; /* CRUCIAL: Allow these grid items to shrink fully */
    }
    .product-images {
        align-items: center; /* Center images */
        width: 100%; /* Ensure image container takes full width */
        flex-direction: column; /* Stack main image and thumbnails */
    }
    #main-product-image {
            width: 100% !important;
            height: auto !important; /* Crucial: Allow height to scale proportionally */
            max-height: 350px !important; /* Adjusted max-height for better scaling on 768px breakpoint */
            object-fit: contain !important; /* Crucial: Ensure entire image is visible, no cropping */
            display: block !important;
            margin: 0 auto !important;
        }
.thumbnail-gallery {
        justify-content: flex-start !important; /* IMPORTANT: Revert to flex-start for first image visibility */
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-left: 2% !important;
        padding-right: 2% !important;
        box-sizing: border-box !important;
        gap: 10px !important;
    }
    .thumbnail-gallery img {
        width: 65px; /* Adjust thumbnail size for mobile */
        height: 65px;
    }

    .product-info-details {
        padding-top: 0; /* No need for top padding when stacked */
        text-align: center; /* Center align product info */
        width: 100%; /* Ensure info takes full width */
    }
    .product-info-details h1 {
        font-size: 2.5rem; /* Further reduce heading size */
        margin-top: 15px; /* Add some space above the title */
    }
    .product-price {
        justify-content: center; /* Center align price */
        margin-bottom: 20px; /* Add space below price */
    }
    .product-rating {
        justify-content: center; /* Center align rating */
        margin-bottom: 20px; /* Add space below rating */
    }
    .product-description {
        text-align: left; /* Keep description left-aligned for readability */
        padding: 0 10px; /* Add some horizontal padding */
    }
    .product-meta {
        text-align: left; /* Keep details list left-aligned for readability */
        padding: 20px 10px; /* Adjust padding */
    }
    .product-meta ul {
        padding-left: 20px; /* Add some padding for list items */
    }
    .add-to-cart-section {
        flex-direction: column; /* Stack quantity and buttons */
        align-items: center; /* Center them */
        gap: 15px; /* Adjust gap */
        padding: 0 10px; /* Add some horizontal padding */
    }
    .quantity-selector {
        width: 100%;
        max-width: 150px; /* Adjusted max-width for better fit on mobile */
        margin: 0 auto; /* Center the selector on mobile */
    }
    .quantity-selector button {
        padding: 8px 12px; /* Adjusted padding for mobile buttons */
        font-size: 1.1rem; /* Slightly larger font for readability */
        height: 36px; /* Adjusted height for mobile consistency */
    }
    .quantity-selector input {
        width: 40px; /* Fixed width for input on 768px */
        font-size: 1.1rem; /* Adjusted font size */
        height: 36px; /* Match button height */
        line-height: 36px; /* Vertical center text */
        margin: 0; /* Crucial: Remove any default margin */
        padding: 0; /* Crucial: Remove any default padding */
        vertical-align: middle; /* Crucial: Align vertically with buttons */
    }
    .add-to-cart-detail-page,
    .buy-now-detail-page {
        width: 100%;
        max-width: 300px; /* Constrain width of these blocks */
    }

    /* Reviews Section Mobile Improvements */
    .product-reviews {
        padding: 40px 3%; /* Adjust padding for mobile */
    }
    .review-item {
        padding: 15px; /* Smaller padding for individual reviews */
        text-align: left; /* Keep review text left-aligned */
    }
    .review-header {
        flex-direction: column; /* Stack name and date */
        align-items: flex-start; /* Align to left */
        margin-bottom: 5px;
    }
    .review-date {
        font-size: 0.85rem;
        margin-top: 3px;
    }
    .review-item .review-rating {
        justify-content: flex-start; /* Align stars to left */
        margin-bottom: 8px;
    }
    .review-comment {
        font-size: 0.95rem; /* Slightly smaller font for comments */
    }
    .review-form-container {
        padding: 25px; /* Smaller padding for the form */
    }
    .review-form label {
        text-align: left; /* Align labels to left */
    }
    .star-rating {
        justify-content: flex-start; /* Align star rating input to left */
    }
    .review-form input[type="text"],
    .review-form textarea {
        padding: 10px; /* Smaller padding for form inputs */
        font-size: 0.95rem;
    }
    .review-form .btn {
        width: 100%; /* Full width button */
        max-width: 250px; /* Constrain width */
        margin: 0 auto; /* Center button */
        padding: 0.8rem 1.5rem; /* Adjust button padding */
    }

    /* Related Products Grid (within product-detail.html) */
    .product-grid { /* This applies to #related-products .product-grid */
        grid-template-columns: 1fr; /* Single column on very small mobile to prevent squishing */
        padding: 0 3%; /* Reduce padding further */
    }
    .product-card { /* This applies to #related-products .product-card */
        max-width: 320px; /* Maintain max-width for single column */
    }
    .product-card img { /* This applies to #related-products .product-card img */
        height: 280px; /* Can go back to original height as it's single column */
    }
}

/* --- Very small mobile devices (max-width: 480px) --- */
@media (max-width: 480px) {
    /* Base Body Padding */
    body {
        padding-top: 60px; /* Slightly less padding for very small screens */
    }

    /* Navbar */
    .nav-container {
        height: 60px; /* Shorter header */
    }
    .logo {
        font-size: 22px; /* Even smaller logo */
    }
    .nav-actions {
        gap: 10px; /* Smaller gap for icons */
    }
    .nav-actions i {
        font-size: 16px; /* Smaller icons */
    }
    .cart-count {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    .main-nav {
        top: 60px; /* Adjust mobile menu position */
    }

    /* --- Product Detail Page Mobile Improvements (Very Small Screens) --- */
    #main-product-image {
            height: auto !important; /* Crucial: Allow height to scale proportionally */
            max-height: 250px !important; /* Further reduced max-height for very small screens */
            object-fit: contain !important; /* Crucial: Ensure entire image is visible, no cropping */
        }


    .thumbnail-gallery {
        justify-content: center !important; /* IMPORTANT: Changed to center for very small screens */
        padding-left: 1% !important;
        padding-right: 1% !important;
        gap: 5px !important;
    }
    .thumbnail-gallery img {
            width: 50px; /* Even smaller thumbnails for tiny screens */
            height: 50px;
        }
    .product-info-details h1 {
        font-size: 2rem; /* Even smaller heading */
    }
    .product-price {
        font-size: 1.5rem;
    }
    .product-description {
        font-size: 0.95rem;
    }
    .product-meta h3 {
        font-size: 1.3rem;
    }
    .product-meta ul li {
        font-size: 0.85rem;
    }
    .add-to-cart-section {
        gap: 10px;
    }
    .quantity-selector button {
        padding: 6px 10px;
        font-size: 0.8rem;
        height: 32px; /* Match input height */
    }
    .quantity-selector input {
        width: 35px; /* Slightly smaller width for very small screens */
        font-size: 0.8rem;
        height: 32px; /* Match button height */
        line-height: 32px; /* Vertical center text */
        margin: 0; /* Crucial: Remove any default margin */
        padding: 0; /* Crucial: Remove any default padding */
        vertical-align: middle; /* Crucial: Align vertically with buttons */
    }
    .add-to-cart-detail-page,
    .buy-now-detail-page {
        font-size: 0.9rem;
        padding: 0.7rem;
    }

    /* Reviews Section adjustments for very small mobiles */
    .review-item {
        padding: 10px;
    }
    .review-comment {
        font-size: 0.85rem;
    }
    .review-form-container {
        padding: 15px;
    }
    .review-form input[type="text"],
    .review-form textarea {
        font-size: 0.85rem;
    }
    .review-form .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    /* Related Products Grid (within product-detail.html) */
    .product-card img {
        height: 200px; /* Adjust height for very small screens */
    }
    .product-card h3 {
        font-size: 16px;
    }
    .product-card .price {
        font-size: 1.2rem;
    }
}
