/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;700&display=swap');

/* Design Variables */
:root {
    --primary-color: #2c3e50;
    /* Deep Navy */
    --accent-color: #27ae60;
    /* Vibrant Green */
    --accent-hover: #219150;
    --text-dark: #333333;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: var(--font-main);
    line-height: 1.6;
}

/* Header/Navigation */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    gap: 12px;
}

.site-logo {
    max-height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo-link:hover .site-logo {
    transform: scale(1.05);
}

.store-name {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: -0.5px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 8px 16px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

nav ul li a:hover {
    background-color: rgba(44, 62, 80, 0.05);
    color: var(--accent-color);
}

main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
    padding: 100px 20px;
    text-align: center;
    border-radius: 0 0 50% 50% / 4%;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

/* Optional: Add a subtle pattern overlay */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(44, 62, 80, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.brand-highlight {
    color: var(--accent-color);
    display: inline-block;
    /* Prevent inline breaking if possible */
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary {
    display: inline-block;
    padding: 15px 35px;
    background-color: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.6);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Featured Products Section */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    padding: 0 20px;
}

.product-card {
    background-color: var(--white);
    padding: 20px;
    border: none;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.product-card h3 {
    margin: 15px 0 10px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary-color);
}

.product-card .price {
    font-size: 1.3em;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 15px;
    display: block;
}

.product-card a {
    background-color: transparent;
    color: var(--accent-color);
    padding: 10px 20px;
    text-decoration: none;
    border: 2px solid var(--accent-color);
    border-radius: 50px;
    display: inline-block;
    margin-top: auto;
    /* Push to bottom */
    font-weight: 600;
    transition: all 0.3s ease;
}

.product-card a:hover {
    background-color: var(--accent-color);
    color: var(--white);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    margin-top: 60px;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border-top: 5px solid var(--accent-color);
}

footer p {
    opacity: 0.8;
}

.product-detail {
    padding: 20px 0;
}

.product-container {
    display: flex;
    gap: 40px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.product-image {
    flex: 1;
    max-width: 400px;
    /* Limit image size */
}

.product-image-container {
    width: 90%;
    padding-top: 100%;
    /* KEY: Creates a 1:1 (square) ratio based on the width */
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    /* Space between image and text */
    border-radius: 4px;
}

/* 2. Style the Image to Fill the Container */
.product-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* THE CRUCIAL FIX: Ensures the image fills the container without distortion */
    object-fit: cover;

    /* Centers the image within the container */
    object-position: center;
}

/* 3. Ensure your product card container (for the text) doesn't have conflicting height rules */
.product-card {
    /* ... (Keep existing styles like background, padding, border) ... */
    display: flex;
    /* IMPORTANT: Use flex or min-height here to maintain structure */
    flex-direction: column;
    height: 100%;
    /* Make sure cards stretch to full height if grid supports it */
}

/* 4. Use flexbox to push the price/link to the bottom */
.product-card a {
    margin-top: auto;
    /* Pushes the "View Details" link to the bottom of the card */
}

.product-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.product-info {
    flex: 2;
}

.product-info h1 {
    margin-top: 0;
    font-size: 2.2em;
}

.product-info .price {
    font-size: 1.8em;
    color: #E74C3C;
    margin: 10px 0 20px 0;
}

.add-to-cart-form input[type="number"] {
    padding: 8px;
    width: 60px;
    margin-right: 15px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.add-to-cart-form button {
    background-color: #2ECC71;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.add-to-cart-form button:hover {
    background-color: #27AE60;
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .product-container {
        flex-direction: column;
    }

    .product-image {
        max-width: 100%;
    }
}

/* Product Listing Page Layout */
.listing-container {
    display: flex;
    gap: 30px;
}

.sidebar {
    width: 250px;
    padding: 20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li a {
    display: block;
    padding: 8px 0;
    text-decoration: none;
    color: #555;
    transition: color 0.2s, background-color 0.2s;
}

.category-list li a:hover {
    color: #3498DB;
}

.category-list li a.active {
    font-weight: bold;
    color: #3498DB;
    background-color: #ecf0f1;
    padding-left: 5px;
}

.product-grid-full {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Reusing the .product-card styles from index.php */

.product-card h4 {
    margin: 5px 0;
    font-size: 1.1em;
}

.category-tag {
    display: block;
    font-size: 0.8em;
    color: #7f8c8d;
    margin-bottom: 10px;
}

/* Cart Page Styling */
.shopping-cart {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.cart-table th {
    background-color: #f8f8f8;
    font-weight: bold;
}

.product-image-cell img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.quantity-cell .qty-input {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.cart-actions {
    text-align: right;
    margin-bottom: 20px;
}

.btn-update {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
    /* This is the magic line that clears the float */
}

/* Cart Totals */
.cart-totals {
    /*float: right;*/
    width: 300px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 1.1em;
}

.grand-total {
    font-weight: bold;
    border-top: 1px solid #ddd;
    margin-top: 10px;
    padding-top: 10px;
    font-size: 1.2em;
}

.btn-checkout {
    display: block;
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background-color: #2ECC71;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.empty-cart-message {
    padding: 40px;
    text-align: center;
    border: 1px dashed #ccc;
    border-radius: 4px;
}

/* Checkout Page Styling */
.checkout-container {
    display: flex;
    gap: 40px;
    max-width: 1000px;
    margin: 20px auto;
}

.checkout-form-col {
    flex: 2;
    /* Takes up 2/3 of the space */
}

.order-summary-col {
    flex: 1;
    /* Takes up 1/3 of the space */
    background: #ecf0f1;
    padding: 20px;
    border-radius: 6px;
    height: fit-content;
    /* Ensure it only takes up necessary vertical space */
}

.shipping-form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}

.shipping-form input[type="text"],
.shipping-form input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.summary-details p {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.summary-details .grand-total {
    font-size: 1.3em;
    font-weight: bold;
    color: #E74C3C;
    padding-top: 10px;
}

.btn-place-order {
    width: 100%;
    background-color: #2ECC71;
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 20px;
}

.payment-method {
    border: 1px solid #ccc;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.payment-method .note {
    font-size: 0.85em;
    color: #7f8c8d;
    margin-top: 5px;
}

/* --- Product Variant Table Styling --- */

.variant-selection-form {
    margin-top: 20px;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    background: #f9f9f9;
}

.variant-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.variant-table th,
.variant-table td {
    border: 1px solid #eee;
    padding: 10px;
    text-align: left;
    vertical-align: middle;
}

.variant-table th {
    background-color: #ecf0f1;
    font-weight: bold;
}

.variant-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.variant-table td.color-cell {
    font-weight: bold;
    text-align: center;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    border: 1px solid #ccc;
}

.quantity-cell {
    width: 100px;
    /* Define width for quantity input */
}

.variant-qty-input {
    width: 70px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

.stock-low {
    color: #E67E22;
    /* Orange for low stock */
    font-weight: bold;
}

.stock-out {
    color: #E74C3C;
    /* Red for out of stock */
    font-weight: bold;
}

.stock-high {
    color: #2ECC71;
    /* Green for high stock */
}

.add-to-cart-action {
    text-align: right;
    margin-top: 20px;
}

.btn-add-variants {
    padding: 12px 25px;
    font-size: 1.1em;
}

.add-to-cart-action .note {
    float: left;
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 15px;
}

/* Styling for the clickable color trigger */
.variant-color-trigger:hover {
    background-color: #e8f5e9;
    /* Light green hover background */
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
}

/* Styling for the currently active color */
.variant-color-trigger.active-color {
    border: 2px solid #2ECC71;
    /* Green border */
    background-color: #dcedc8;
    /* Slightly darker than hover */
}

/* Size Guide Modal */
.size-guide-link {
    display: inline-block;
    margin-bottom: 10px;
    color: #3498DB;
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    color: #aaa;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: #333;
    text-decoration: none;
}

.size-chart-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.size-chart-table th,
.size-chart-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
}

.size-chart-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

/* Color Swatches Area */
.product-swatches {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.swatch-label {
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #333;
}

.swatch-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.swatch-btn {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.swatch-btn:hover {
    border-color: #3498DB;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.swatch-btn.active-color {
    border-color: #2ECC71;
    background-color: #e8f5e9;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.swatch-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid #ccc;
    display: inline-block;
}

/* Home Page Category Grid */
.category-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.category-card-home {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: white;
    padding: 0;
    /* Removed padding to let image fill top */
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-align: center;
    border-bottom: 3px solid #3498DB;
    overflow: hidden;
    /* Ensure image doesn't overflow rounded corners */
}

.category-card-home:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: #3498DB;
    color: white;
}

.category-img-container {
    width: 100%;
    height: 80px;
    /* Reduced height as requested */
    overflow: hidden;
    background-color: #f4f4f4;
    border-bottom: 1px solid #eee;
}

.category-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card-home:hover .category-card-img {
    transform: scale(1.05);
    /* Subtle zoom effect */
}

.category-card-home h3 {
    margin: 15px 0 10px 0;
    /* Add margin back since padding was removed */
    font-size: 1.4em;
    padding: 0 10px;
}

.view-products-link {
    font-size: 0.9em;
    color: #3498DB;
    font-weight: bold;
    margin-bottom: 20px;
    /* Add bottom spacing */
    display: inline-block;
}

/* --- About Us Page Styling --- */
.about-page-container,
.contact-page-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.about-hero,
.contact-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.about-hero h1,
.contact-header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
}

.about-section {
    margin-bottom: 30px;
}

.about-section h2 {
    color: #3498DB;
    margin-bottom: 15px;
}

.about-section p {
    line-height: 1.6;
    color: #555;
    font-size: 1.1em;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.service-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #eee;
}

.service-card h3 {
    color: #2ECC71;
    margin-bottom: 10px;
}

/* --- Contact Us Page Styling --- */
.contact-wrapper {
    display: flex;
    gap: 40px;
}

.contact-info,
.contact-form-container {
    flex: 1;
}

.contact-info {
    background: #f4f8fb;
    padding: 30px;
    border-radius: 8px;
}

.info-item {
    margin-bottom: 20px;
    font-size: 1.05em;
    color: #555;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

.btn-block {
    width: 100%;
    padding: 12px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

@media (max-width: 768px) {
    .contact-wrapper {
        flex-direction: column;
    }
}