/*
=================================================
Glow E-commerce Store Stylesheet
Final Version (with Mobile Fixes)
=================================================
*/

/* --- 0. Root Variables & Global Styles --- */
:root {
    --cherry: #41101B;
    --milk: #FFFBF4;
    --black: #222323;
    --border-color: #f2e9e4;
    --font-family: 'Almarai', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: #fff;
    color: var(--black);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- 1. Header --- */
header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    border-bottom: 3px solid var(--cherry);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
    gap: 1.5rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--cherry);
}

.search-bar {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

#search-input {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: #fff;
}

#search-input:focus {
    outline: none;
    border-color: var(--cherry);
}

.search-bar .fa-search {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #ccc;
}

header nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

header nav a {
    text-decoration: none;
    color: var(--black);
    font-weight: 700;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s ease;
    white-space: nowrap;
}

header nav a:hover {
    color: var(--cherry);
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--cherry);
    transition: width 0.3s ease;
}

header nav a:hover::after, header nav a.active::after {
    width: 100%;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-icon {
    font-size: 1.5rem;
    color: var(--black);
    text-decoration: none;
    position: relative;
}

.cart-icon {
    position: relative;
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--cherry);
    color: var(--milk);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}

/* --- 2. Main Content Sections --- */
/* --- Hero Section --- */
.hero {
    height: 80vh;
    background-color: var(--cherry);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--milk);
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    background: var(--milk);
    color: var(--cherry);
    padding: 0.8rem 2.5rem;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    border: 2px solid var(--milk);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    background: transparent;
    color: var(--milk);
}

/* --- Products Section --- */
.products-section {
    padding: 5rem 0;
    background: #fff;
}

.products-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--cherry);
}

/* New: Controls container for filter and sort */
.controls-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; /* Space between filter and sort */
    align-items: center;
    gap: 1.5rem; /* Space between rows/columns on smaller screens */
    margin-bottom: 3rem;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    /* margin-bottom: 3rem;  -- Removed as it's now inside controls-container */
}

.filter-btn {
    background-color: transparent;
    color: var(--black);
    border: 2px solid var(--border-color);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-family: var(--font-family);
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--milk);
    border-color: var(--cherry);
}

.filter-btn.active {
    background-color: var(--cherry);
    color: var(--milk);
    border-color: var(--cherry);
}

/* New: Sort Options styles */
.sort-options {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.sort-options label {
    font-weight: 700;
    color: var(--black);
    font-size: 1rem;
}

#sort-select {
    padding: 0.6rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    font-family: var(--font-family);
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
    -webkit-appearance: none; /* Remove default arrow on Webkit browsers */
    -moz-appearance: none; /* Remove default arrow on Firefox */
    appearance: none; /* Remove default arrow */
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%2341101B" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: left 0.8rem center; /* Position arrow on the left for RTL */
    padding-left: 2.5rem; /* Space for the arrow */
}

#sort-select:hover,
#sort-select:focus {
    border-color: var(--cherry);
}


.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* --- Product Card --- */
.product-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(65, 16, 27, 0.15);
}

.product-card-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px 15px 0 0;
}

.product-image-link {
    display: block;
}

.product-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.product-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.product-card:hover .product-card-overlay {
    opacity: 1;
}

.wishlist-btn, .quick-view-btn {
    pointer-events: all;
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
}

.wishlist-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    color: #ccc;
    top: 15px;
    right: 15px;
}

.wishlist-btn.active {
    color: #e63946;
}

.quick-view-btn {
    padding: 0.6rem 1rem;
    color: var(--cherry);
    white-space: nowrap;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
}

.product-info {
    padding: 1.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name-link {
    text-decoration: none;
    color: inherit;
}

.product-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--black);
}

.product-info .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--cherry);
    margin-bottom: 1rem;
}

.view-details-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: var(--cherry);
    color: var(--milk);
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-family: var(--font-family);
    margin-top: auto;
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.view-details-btn:hover {
    opacity: 0.85;
}

/* --- Testimonials --- */
.testimonials {
    background: var(--milk);
    padding: 5rem 0;
    text-align: center;
}
.testimonials h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--cherry);
}
.testimonial-card {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 15px;
}
.testimonial-card span {
    display: block;
    margin-top: 1rem;
    font-weight: 700;
    color: var(--cherry);
}

/* --- 3. Footer --- */
footer {
    background: var(--cherry);
    color: var(--milk);
    padding: 3rem 2rem 1rem 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-about, .footer-links, .footer-social {
    flex: 1;
    min-width: 220px;
}

.footer-about p, .footer-links a, .footer-social a, .copyright {
    color: var(--milk);
    opacity: 0.9;
}

.footer-about h3, .footer-links h3, .footer-social h3 {
    color: #fff;
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a, .footer-social a {
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-links a:hover, .footer-social a:hover {
    opacity: 1;
}

.footer-social a {
    font-size: 1.5rem;
    margin-left: 1rem;
}
.footer-social a:first-child {
    margin-left: 0;
}

.payment-methods {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.payment-methods h4 {
    margin-bottom: 1rem;
    color: #fff;
}

.payment-icons img {
    height: 30px;
    margin: 0 0.5rem;
    background-color: #fff;
    border-radius: 5px;
    padding: 2px;
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    font-size: 0.9rem;
}

/* --- 4. Page-Specific & Component Styles --- */
/* --- Static Pages (About, Policy) --- */
.static-page .container {
    padding-top: 4rem;
    padding-bottom: 4rem;
}
.static-page h1 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--cherry);
}
.static-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--milk);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.static-content h3 {
    color: var(--cherry);
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.static-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* --- Cart Page Styles --- */
.cart-page .container {
    padding-top: 4rem;
    padding-bottom: 4rem;
}
.cart-page h1 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--cherry);
}
.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: flex-start;
}
.cart-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1rem;
    background: #fff;
}
.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}
.cart-item-details {
    flex-grow: 1;
}
.cart-item-details h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.cart-item-price {
    font-weight: 700;
    color: var(--cherry);
}
.cart-item-actions {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.2rem;
}
.quantity-btn, .remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    color: var(--black);
}
.remove-btn {
    color: #e63946;
    font-size: 1.2rem;
}
.cart-summary {
    background-color: var(--milk);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    position: sticky;
    top: 120px;
}
.cart-summary h3 {
    margin-bottom: 1.5rem;
    color: var(--cherry);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}
.checkout-btn {
    width: 100%;
    text-align: center;
    text-decoration: none;
    padding: 1rem;
    font-size: 1.2rem;
    background: var(--cherry);
    color: var(--milk);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: opacity 0.3s ease;
}
.checkout-btn:hover {
    opacity: 0.9;
}
.empty-cart-message {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.5rem;
    padding: 4rem;
    color: #888;
}

/* --- Quick View Modal Styles (معدل - Modified) --- */
.modal-overlay {
    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: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.close-modal-btn {
    position: absolute;
    top: 10px;
    left: 20px;
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: #aaa;
}
.quick-view-layout {
    display: flex;
    gap: 2rem;
    align-items: center;
    direction: rtl;
}
.quick-view-image {
    flex-basis: 40%;
}
.quick-view-image img {
    width: 100%;
    border-radius: 10px;
}
.quick-view-details {
    flex-basis: 60%;
}
.quick-view-details h3 {
    font-size: 2rem;
    color: var(--cherry);
}
.quick-view-details .price {
    font-size: 1.5rem;
    color: var(--black);
    font-weight: bold;
    margin: 1rem 0;
}

/* New: Styles for Quick View Quantity and Add to Cart */
.quick-view-details .product-actions { /* Re-using .product-actions class */
    margin-top: 1.5rem; /* Slightly less margin than main product page */
}
.quick-view-details .quantity-selector { /* Re-using .quantity-selector class */
    width: 100px; /* Adjust width for modal */
    padding: 0.3rem;
}
.quick-view-details .quantity-btn {
    font-size: 1.3rem;
}
.quick-view-details .quantity-display {
    font-size: 1.1rem;
}
.quick-view-details .add-to-cart-btn-large {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    flex-shrink: 0; /* Prevent button from shrinking too much */
}

.quick-view-details .btn { /* For "عرض الصفحة الكاملة" button */
    margin-top: 1.5rem;
}


/* --- Product Detail Page Styles --- */
#product-detail-container {
    padding-top: 4rem;
    padding-bottom: 4rem;
}
.product-detail-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    align-items: flex-start;
}
.product-image-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.main-image-container {
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
}
#main-product-image {
    width: 100%;
    display: block;
    border-radius: 15px;
}
.thumbnail-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.thumbnail-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}
.thumbnail-image.active {
    border-color: var(--cherry);
}
.product-details-content h1 {
    font-size: 2.5rem;
    color: var(--cherry);
    margin-bottom: 1rem;
    line-height: 1.2;
}
.product-details-content .product-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 1.5rem;
}
.product-details-content .product-description {
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 1rem;
    color: #555;
}

/* Styles for Product Quantity Controls */
.product-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Space between quantity selector and add to cart button */
    margin-top: 2rem;
}

.product-details-content .quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Slightly larger border-radius for aesthetic */
    padding: 0.4rem; /* Adjusted padding */
    width: 120px; /* Fixed width for consistency */
    justify-content: space-between;
}

.product-details-content .quantity-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem; /* Larger font size for buttons */
    color: var(--black);
    padding: 0 0.5rem;
    line-height: 1; /* Align text vertically */
}

.product-details-content .quantity-btn:hover {
    color: var(--cherry);
}

.product-details-content .quantity-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--black);
    min-width: 30px; /* Ensure space for quantity */
    text-align: center;
}

.add-to-cart-btn-large {
    flex-grow: 1; /* Allow button to take remaining space */
    padding: 1rem;
    font-size: 1.2rem;
    background: var(--cherry);
    color: var(--milk);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    transition: opacity 0.3s ease;
    /* margin-top: 2rem; -- Removed as it's now inside product-actions */
}
.add-to-cart-btn-large:hover {
    opacity: 0.9;
}
#related-products {
    background-color: var(--milk);
    padding-bottom: 5rem;
}

/* --- Checkout Page Styles --- */
.checkout-page .container {
    padding-top: 4rem;
    padding-bottom: 4rem;
}
.checkout-page h1 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--cherry);
}
.checkout-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}
.customer-details h3, .order-summary h3 {
    margin-bottom: 1.5rem;
    color: var(--cherry);
    font-size: 1.5rem;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.form-group input {
    width: 100%;
    padding: 0.8rem;
    font-family: var(--font-family);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.3s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--cherry);
}
.confirm-order-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    background: var(--cherry);
    color: var(--milk);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: opacity 0.3s ease;
}
.confirm-order-btn:hover {
    opacity: 0.9;
}
.order-summary {
    background-color: var(--milk);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    position: sticky;
    top: 120px;
}
.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.summary-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}
.summary-item-details {
    display: flex;
    justify-content: space-between;
    flex-grow: 1;
    align-items: center;
}

/* --- Notification Styles --- */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: var(--cherry);
    color: var(--milk);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    z-index: 3000;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out, visibility 0.5s ease-out;
    min-width: 250px;
    text-align: center;
    font-weight: 700;
}

.notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- Contact Page Styles --- */
.contact-page .contact-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--milk);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.contact-page .intro-text {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #555;
    line-height: 1.7;
}

.contact-details-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* Form takes more space */
    gap: 3rem;
    align-items: flex-start;
}

.contact-form-container h3,
.contact-info-container h3 {
    color: var(--cherry);
    font-size: 1.7rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.contact-form-container form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form-container .form-group label {
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: block;
}

.contact-form-container .form-group input[type="text"],
.contact-form-container .form-group input[type="email"],
.contact-form-container .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: #fff;
    resize: vertical; /* Allow vertical resizing for textarea */
}

.contact-form-container .form-group input:focus,
.contact-form-container .form-group textarea:focus {
    outline: none;
    border-color: var(--cherry);
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--cherry);
    color: var(--milk);
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.3s ease;
    margin-top: 1rem;
}

.submit-btn:hover {
    opacity: 0.9;
}

.contact-info-container {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-method i {
    font-size: 1.5rem;
    color: var(--cherry);
    width: 30px; /* Fixed width for icon alignment */
    text-align: center;
}

.contact-method a {
    text-decoration: none;
    color: var(--black);
    transition: color 0.3s ease;
}
.contact-method a:hover {
    color: var(--cherry);
}
.whatsapp-link span {
    display: block;
    font-size: 0.9rem;
    color: #777;
}

.social-links-contact {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.social-links-contact h3 {
    border-bottom: none; /* No border for this one */
    margin-bottom: 1rem;
}
.social-links-contact a {
    font-size: 1.8rem;
    color: var(--black);
    margin-left: 1rem;
    transition: color 0.3s ease;
}
.social-links-contact a:hover {
    color: var(--cherry);
}
.social-links-contact a:first-child {
    margin-left: 0;
}


/* --- 5. Utility Styles --- */
/* --- Back to Top Button Styles --- */
.back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--cherry);
    color: var(--milk);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}
.back-to-top-btn.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top-btn:hover {
    opacity: 0.9;
}

/* --- Responsive Design (Final Mobile Fix) --- */

/* For Tablets and smaller devices */
@media (max-width: 992px) {
    .cart-container,
    .checkout-layout,
    .product-detail-layout {
        grid-template-columns: 1fr; /* Stack columns on top of each other */
    }

    .cart-summary,
    .order-summary {
        position: static; /* Prevent summary box from being sticky on mobile */
        margin-top: 2rem;
    }
    
    /* Adjust controls container for tablets */
    .controls-container {
        flex-direction: column; /* Stack filter and sort vertically */
        align-items: center; /* Center items when stacked */
    }

    .filter-buttons, .sort-options {
        width: 100%; /* Make them take full width */
        justify-content: center; /* Center filter buttons */
    }

    /* Contact Page Tablet Adjustments */
    .contact-details-grid {
        grid-template-columns: 1fr; /* Stack form and info vertically */
    }
    .contact-form-container,
    .contact-info-container {
        padding: 1.5rem; /* Adjust padding for smaller screens */
    }

    /* Product Detail Page Tablet Adjustments */
    .product-detail-layout {
        grid-template-columns: 1fr; /* Stack images and details vertically */
    }
    .product-actions {
        flex-direction: column; /* Stack quantity and button vertically */
        gap: 1rem;
        width: 100%; /* Make actions take full width */
    }
    .product-details-content .quantity-selector {
        width: 100%; /* Make quantity selector take full width */
        justify-content: center; /* Center quantity controls */
    }
}

/* For Mobile phones */
@media (max-width: 768px) {
    /* --- Header Fixes --- */
    header .container {
        flex-wrap: wrap; /* Allow items to wrap to the next line */
        justify-content: center;
        row-gap: 1rem;
    }

    .logo {
        width: 100%;
        text-align: center;
    }

    header nav {
        order: 3; /* Make navigation appear last */
        width: 100%;
        justify-content: center;
    }
    header nav ul {
        justify-content: center;
        gap: 1.5rem;
    }

    .search-bar {
        order: 2; /* Make search appear after logo */
        width: 100%;
        max-width: 100%;
    }

    .header-icons {
        position: absolute; /* Position icons independently */
        top: 1.5rem;
        left: 1rem;
        gap: 1rem;
    }

    /* --- General Layout Fixes --- */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-social a {
        margin: 0 0.5rem;
    }

    .quick-view-layout {
        flex-direction: column;
        text-align: center;
    }

    /* Contact Page Mobile Adjustments */
    .contact-form-container h3,
    .contact-info-container h3 {
        font-size: 1.5rem; /* Smaller headings for mobile */
    }
    .contact-page .intro-text {
        font-size: 1rem;
    }
    .contact-method {
        flex-direction: column; /* Stack icon and text */
        text-align: center;
        gap: 0.5rem;
    }
    .contact-method i {
        margin-bottom: 0.5rem;
    }
    .social-links-contact a {
        margin: 0 0.7rem;
    }

    /* Product Detail Page Mobile Adjustments */
    .product-image-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .thumbnail-container {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); /* More flexible thumbnails */
    }
}