:root {
    --primary-dark: #222222;
    --accent-gold: #c5a059;
    --bg-cream: #fcfbfa;
    --secondary-dark: #4a4a4a;
    --white: #ffffff;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    margin: 0;
    color: var(--secondary-dark);
    background-color: var(--bg-cream);
    line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--primary-dark); }

header {
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; color: var(--primary-dark); }

nav ul { display: flex; list-style: none; gap: 2rem; margin: 0; }
nav a { text-decoration: none; color: var(--secondary-dark); font-weight: 500; }

#hero {
    background-color: #f5f2ed;
    padding: 4rem 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}
.hero-content {
    max-width: 550px;
    background: transparent;
    padding: 0;
    box-shadow: none;
}
.hero-image {
    width: 100%;
    max-width: 600px;
}
.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
@media (min-width: 768px) {
    #hero {
        flex-direction: row;
        justify-content: center;
        padding: 6rem 10%;
        gap: 4rem;
    }
    .hero-content {
        flex: 1;
    }
    .hero-image {
        flex: 1;
    }
}

.cta-button {
    background: var(--accent-gold);
    color: var(--primary-dark);
    padding: 1rem 2rem;
    text-decoration: none;
    display: inline-block;
    margin-top: 1.5rem;
    font-weight: 600;
    transition: background 0.3s;
}

.cta-button:hover { background: #b89047; }

#trust-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding: 4rem 5%;
    background: var(--white);
    text-align: center;
}

.badge { font-weight: 600; color: var(--primary-dark); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 3rem;
    padding: 0 5%;
}

.product-card { background: var(--white); padding: 2rem; border: 1px solid #eee; }

#cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    padding: 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 2000;
}

#cart-drawer.open { transform: translateX(0); }
#cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
    display: none;
}
#cart-overlay.open { display: block; }

.size-selector button {
    margin-right: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border: 1px solid var(--accent-gold);
    background: transparent;
}
.size-selector button.active { background: var(--accent-gold); color: var(--primary-dark); }
.size-selector button:hover { background: var(--accent-gold); color: var(--primary-dark); }

.color-swatch {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    cursor: pointer;
    border: 2px solid transparent;
}
.color-swatch.active { border-color: var(--accent-gold); }

#science, #reviews { padding: 4rem 5%; }
table { width: 100%; border-collapse: collapse; margin-top: 2rem; }
th, td { padding: 1rem; border: 1px solid #eee; text-align: center; }

.review { background: white; padding: 2rem; margin-bottom: 1rem; border-left: 4px solid var(--accent-gold); }

.cart-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--primary-dark);
}

#shop {
    padding: 5rem 5%;
    background-color: var(--bg-cream);
}

.section-title {
    text-align: center;
    margin-top: 0;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

.cart-content {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-close-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.5rem;
}

.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    margin: 1rem 0;
}

.cart-footer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.cart-footer-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.cart-footer-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.cart-checkout-btn {
    width: 100%;
    color: var(--primary-dark);
}

#science {
    background: #f9f7f3;
    padding: 4rem 5%;
}

.science-desc {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table thead {
    background: #eaddc9;
}

.comparison-table th {
    padding: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    text-align: center;
}

.comparison-table td {
    padding: 1.2rem;
    border: 1px solid #eee;
    text-align: center;
}

#reviews {
    padding: 4rem 5%;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.review-stars {
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

footer {
    background: #222;
    color: #ccc;
    padding: 4rem 5%;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
}

.footer-col h3, .footer-col h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--accent-gold);
}

.newsletter-input {
    padding: 0.75rem;
    width: 100%;
    margin-bottom: 0.5rem;
    border: 1px solid #444;
    background: #333;
    color: white;
    border-radius: 4px;
}

.newsletter-btn {
    margin-top: 0;
    width: 100%;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.8rem;
    color: #888;
}

#checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 3000;
    display: none;
    overflow-y: auto;
    padding: 2rem 1rem;
}
.modal-content {
    background: white;
    margin: auto;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}
.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
}
.checkout-form-side {
    flex: 1;
    padding: 2rem;
}
.checkout-summary-side {
    flex: 0 0 100%;
    background: #f9f9f9;
    padding: 2rem;
    border-top: 1px solid #eee;
}
.checkout-input {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-body);
}
.checkout-row {
    display: flex;
    gap: 1rem;
}
.checkout-loading-view {
    text-align: center;
    padding: 3rem 0;
}
.checkout-loading-text {
    margin-top: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
}
.checkout-success-view {
    text-align: center;
    padding: 2rem 0;
}
.checkout-success-icon {
    font-size: 3rem;
    color: #2d4a43;
    margin-bottom: 1rem;
}
.summary-items-container {
    margin-top: 1rem;
}
.summary-totals {
    border-top: 1px solid #ddd;
    margin-top: 1rem;
    padding-top: 1rem;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.summary-total-row {
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .modal-content { flex-direction: row; }
    .checkout-form-side { padding: 3rem; }
    .checkout-summary-side { flex: 0 0 350px; border-top: none; border-left: 1px solid #eee; padding: 3rem; }
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}
.cart-item-details { flex-grow: 1; }
.cart-item-details h4 { font-size: 0.95rem; font-weight: 600; margin: 0; }
.cart-item-details p { font-size: 0.85rem; color: #777; margin: 0; }
.cart-item-controls { display: flex; align-items: center; gap: 0.5rem; }
.cart-item-controls button {
    background: #eee;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
.cart-item-controls button:hover { background: #ddd; }
.remove-btn {
    background: none;
    border: none;
    color: #999;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.8rem;
}
.remove-btn:hover { color: #e00; }

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
