:root {
    --primary-color: #0f0f0f;
    --secondary-color: #f4f4f4;
    --accent-color: #c5a059;
    --accent-light: #e0b06b;
    --text-color: #2a2a2a;
    --light-text: #666;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.06);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --container-width: 1400px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

ul {
    list-style: none;
}

body {
    font-family: var(--font-body);
    background-color: #fafafa;
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 700;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-error {
    background: #e74c3c;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    letter-spacing: 2px;
    font-weight: 800;
    text-transform: uppercase;
}

nav ul {
    display: flex;
    gap: 50px;
    list-style: none;
}

nav a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    font-weight: 500;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Buttons */
.btn {
    padding: 15px 40px;
    background: var(--primary-color);
    color: white;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.btn-outline {
    padding: 10px 20px;
    border: 1px solid #ddd;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Hero */
.hero {
    padding: 160px 0 120px;
    text-align: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1560131460-7080f55b119a?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
    /* Placeholder Marble BG */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax */
    color: white;
    margin-bottom: 60px;
}

.hero h1 {
    color: white;
    font-size: 4.5rem;
    margin-bottom: 25px;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto 45px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Layout Grid (Restored) */
.layout-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 60px;
    margin-top: 60px;
    margin-bottom: 100px;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 140px;
    height: fit-content;
}

.sidebar h3 {
    font-size: 1.2rem;
    font-family: var(--font-heading);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.filter-group {
    margin-bottom: 35px;
}

.filter-group h4 {
    font-size: 0.95rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.filter-group ul {
    list-style: none;
}

.filter-group ul li {
    margin-bottom: 12px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--light-text);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.filter-group label:hover {
    color: var(--primary-color);
}

.filter-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary-color);
}

/* Products */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    margin: 60px 0;
}

.product-card {
    cursor: pointer;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.product-image {
    margin-bottom: 25px;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    width: 100%;
    padding-bottom: 100%;
    /* 1:1 aspect ratio */
    background: #f9f9f9;
    height: 0;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover .product-image {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-info h2 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    /* Reduced from 10px to pull price up */
}

.product-info .price {
    color: var(--accent-color);
    font-weight: 700;
    /* Increased weight */
    font-family: var(--font-heading);
    font-size: 1.3rem;
    /* Slightly larger */
    margin-bottom: 15px;
    /* Add space below price before button */
    display: block;
}

/* Forms (Login, Contact) */
input,
textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #e0e0e0;
    background: #fbfbfb;
    margin-bottom: 20px;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

label {
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Fix Radio/Checkbox Width Override */
input[type="radio"],
input[type="checkbox"] {
    width: auto;
    margin-bottom: 0;
    display: inline-block;
    vertical-align: middle;
}

.payment-form {
    padding: 40px;
    background: #fff;
    border: 1px solid #eee;
}

/* New Content Sections */
.features-section {
    padding: 100px 0;
    background: #f9f9f9;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: center;
}

.feature-box h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.feature-box p {
    color: var(--light-text);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    padding: 100px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 80px;
}

.footer-col h4 {
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

.footer-col ul li {
    margin-bottom: 15px;
}

.footer-col a {
    color: #888;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: white;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Badges */
.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-color);
    color: white;
    padding: 5px 10px;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    font-weight: bold;
    z-index: 10;
}

/* Newsletter Section */
.newsletter-section {
    padding: 100px 0;
    background: var(--primary-color);
    color: white;
    text-align: center;
}

.newsletter-box {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-box h3 {
    color: white;
    font-size: 2rem;
    margin-bottom: 15px;
}

.newsletter-box p {
    color: #999;
    margin-bottom: 30px;
}

.newsletter-form {
    display: flex;
    gap: 15px;
}

.newsletter-form input {
    margin-bottom: 0;
    border: none;
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        padding: 0 20px;
    }

    .layout-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        margin-bottom: 10px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .sidebar {
        display: none;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Force square format */
    overflow: hidden;
    border-radius: 8px;
    background-color: #f5f5f5;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: none;
    transition: opacity 0.3s ease-in-out;
}

.carousel-img.active {
    display: block;
}

/* Carousel Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

/* Carousel Dots */
.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.dot.active {
    background-color: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

.dot:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Product card carousel adjustments */
.product-card .carousel-container {
    height: 300px;
    margin-bottom: 20px;
}

.product-card .carousel-btn {
    width: 35px;
    height: 35px;
    font-size: 18px;
}

.product-card .carousel-dots {
    bottom: 10px;
    gap: 6px;
}

.product-card .dot {
    width: 8px;
    height: 8px;
}

/* =========================================
   MOBILE RESPONSIVENESS PATCH (Cart/Product/Account/Checkout)
   ========================================= */

/* Common Layouts (Replacing Inline Styles) */
.product-detail-container,
.cart-layout,
.account-layout,
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Default Two Cols for Desktop */
    gap: 60px;
    margin-top: 40px;
    align-items: start;
}

.cart-layout {
    grid-template-columns: 2fr 1fr;
}

.form-row {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Fluid Images */
img {
    max-width: 100%;
    height: auto;
}

/* Mobile Overrides */
@media (max-width: 900px) {

    .product-detail-container,
    .cart-layout,
    .account-layout,
    .form-row {
        grid-template-columns: 1fr !important;
        /* Force Stack */
        gap: 30px !important;
    }

    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* Cart Specifics */
    .cart-layout {
        display: flex !important;
        flex-direction: column;
    }

    /* Product Gallery on Top */
    .product-gallery {
        margin-bottom: 20px;
    }

    .carousel-container {
        height: 300px !important;
        /* Reduced from 500px */
    }

    h1 {
        font-size: 2rem !important;
        word-break: break-word;
    }

    /* Input Font Size Fix for iPhone zoom */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    /* User Type Buttons Mobile Stack */
    .user-type-grid {
        flex-direction: column !important;
    }
}

/* User Type Selector Styles */
.user-type-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    border: 1px solid #eee;
}

.user-type-grid {
    display: flex;
    gap: 20px;
}

.type-option {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 8px;
    flex: 1;
    transition: all 0.2s;
    overflow: hidden;
    /* Added Safety */
}

/* Fix Text Wrapping inside Button */
.type-option>div {
    flex: 1;
    min-width: 0;
    /* Key for Flexbox text wrapping */
}

.type-option:hover {
    border-color: var(--primary-color);
    background: #fcfcfc;
}

/* --- Product Page Modules (Premium Style) --- */

/* Stock Badge */
.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.stock-badge::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #27ae60;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
}

/* Specifications Table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-family: var(--font-body);
}

.specs-table tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table tr:hover {
    background-color: #fafafa;
}

.specs-table td {
    padding: 16px 10px;
    vertical-align: middle;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

.specs-table td.spec-label {
    font-weight: 600;
    color: var(--primary-color);
    width: 35%;
    font-family: var(--font-heading);
}

/* Material Calculator */
.material-calculator {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #ececec;
    margin-top: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.material-calculator h3 {
    font-size: 1.1rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 15px;
}

.material-calculator h3 i {
    color: var(--accent-color);
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.calc-input-group label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.calc-input-group input,
.calc-input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fcfcfc;
    font-size: 0.95rem;
    color: var(--primary-color);
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.calc-input-group input:focus,
.calc-input-group select:focus {
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.1);
    outline: none;
}

.calc-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
}

.calc-result-box {
    background: transparent;
    padding: 0;
    border: none;
}

.calc-result-box label {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.calc-result-box .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
    font-family: var(--font-heading);
}

/* Responsive Layout for New Modules Grid */
@media (max-width: 1000px) {
    .container.product-detail-container {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    .extended-modules-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 600px) {

    .calc-grid,
    .calc-results-grid {
        grid-template-columns: 1fr;
    }

    .material-calculator {
        padding: 0;
    }
}