/* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Syne:wght@400;700;800&family=Inter:wght@300;400;600&display=swap');

:root {
    --primary-black: #111111;
    --primary-white: #FAFAFA;
    --accent-red: #D32F2F;
    --soft-gray: #EAEAEA;
    --text-gray: #555555;
    --font-display: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-poppins: 'Poppins', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-body); background-color: var(--primary-white); color: var(--primary-black); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Header & Bulletproof Centering Layout */
header { 
    position: sticky; 
    top: 0; 
    left: 0; 
    width: 100%; 
    background-color: rgba(250, 250, 250, 0.95); 
    backdrop-filter: blur(10px); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 5%; 
    height: 84px; 
    z-index: 9999; 
    border-bottom: 1px solid var(--soft-gray); 
    transition: all 0.3s ease; 
    color: var(--primary-black); 
}

.header-left {
    display: flex;
    align-items: center;
    z-index: 2;
}
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 2;
}
.header-middle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    z-index: 1;
}

/* Compound Icon on Left */
.compound-icon-link {
    display: flex;
    align-items: center;
}
.compound-icon-link img {
    height: 80px; 
    width: auto;
    margin-top: -5px;
    margin-bottom: -5px;
    transition: transform 0.3s ease, filter 0.3s ease;
}
.compound-icon-link:hover img {
    transform: scale(1.12);
}

/* Centered Caffeinic Logo */
.header-middle .logo { 
    display: flex; 
    align-items: center; 
}
.header-middle .logo img { 
    height: 300px; 
    width: auto; 
    display: block; 
    filter: invert(1); 
    transition: filter 0.3s ease;
    margin-top: -5px;
    margin-bottom: -15px;
}

/* Custom Amazon Pill Button */
.amazon-pill-btn {
    background-color: #1a1a1a;
    border: 1px solid #333;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.9rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}
.amazon-pill-btn:hover {
    background-color: #2c2c2c;
    border-color: #ff9900;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.pill-top {
    font-size: 0.5rem;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: -2px;
    font-family: var(--font-body);
    font-weight: 600;
}
.pill-main {
    display: flex;
    align-items: center;
    gap: 6px;
}
.amazon-word {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
    letter-spacing: -0.5px;
}
.pill-arrow {
    color: #ff9900;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1;
    margin-top: -2px;
}

/* Transparent Header Modifiers for Homepage */
header.transparent { position: fixed; top: 0; left: 0; width: 100%; background-color: transparent; backdrop-filter: none; border-bottom: none; color: var(--primary-white); }
header.transparent .amazon-pill-btn { background-color: rgba(0,0,0,0.6); border-color: rgba(255,255,255,0.2); }
header.transparent .header-middle .logo img { filter: none; }
header.transparent .compound-icon-link img { filter: none; }

header.scrolled { position: fixed; top: 0; left: 0; width: 100%; background-color: rgba(250, 250, 250, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--soft-gray); color: var(--primary-black); }
header.scrolled .amazon-pill-btn { background-color: #1a1a1a; border-color: #333; }
header.scrolled .header-middle .logo img { filter: invert(1); }
header.scrolled .compound-icon-link img { filter: invert(1); }

/* Dark Header Modifier for Inner Pages */
header.dark-header {
    background-color: #1C1918;
    color: var(--primary-white);
    border-bottom: 1px solid #333;
}
header.dark-header .header-middle .logo img {
    filter: none;
}
header.dark-header .compound-icon-link img {
    filter: none;
}

/* Footer (4-Column Layout) */
footer { background-color: #1C1918; color: var(--primary-white); padding: 5rem 5% 2rem; border-top: 1px solid #333; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1.5fr; gap: 2.5rem; margin-bottom: 4rem; align-items: start; }
.footer-col h4 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 1.5rem; text-transform: uppercase; color: var(--primary-white); }
.footer-col ul li { margin-bottom: 0.8rem; }
.footer-col ul li a { color: #DDDDDD; transition: color 0.3s ease; display: inline-flex; align-items: center; }
.footer-col ul li a:hover { color: var(--accent-red); }
.footer-bottom { text-align: center; color: #999999; font-size: 0.8rem; border-top: 1px solid #333; padding-top: 2rem; }

/* Right-aligned Footer Logo and Tagline */
.footer-right-col {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.footer-right-col .logo img { 
    width: 180px; 
    height: auto; 
    filter: brightness(0) invert(1); 
    margin-bottom: 0.5rem; 
}
.footer-tagline {
    color: #CCCCCC;
    font-size: 0.95rem;
}

/* Page Specific: Hero Section */
.hero { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1497935586351-b67a49e012bf?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat; color: var(--primary-white); }

.hero-content { 
    width: 100%; 
    max-width: 1100px; 
    padding: 0 5%; 
}
.hero-content h1 { 
    font-family: var(--font-poppins); 
    font-size: clamp(2.5rem, 4.5vw, 5rem); 
    font-weight: 600; 
    font-style: italic; 
    line-height: 1.2; 
    margin-bottom: 1.5rem; 
    text-align: center; 
}
.hero-link-container { 
    text-align: right; 
    padding-right: 0; 
    margin-top: 4rem; 
    transform: translateX(3.5rem); 
}
.hero-text-link { 
    font-family: var(--font-poppins); 
    font-weight: 400; 
    font-style: italic; 
    font-size: clamp(0.96rem, 1.6vw, 1.44rem); 
    color: var(--primary-white); 
    text-decoration: none; 
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease; 
    border-bottom: 1px solid transparent; 
}
.hero-text-link:hover { 
    transform: scale(1.08); 
    opacity: 0.9; 
    border-bottom: 1px solid var(--primary-white); 
}

/* Text Buffer Section */
.text-buffer {
    padding: 8rem 5%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-white);
}

.text-buffer-content {
    max-width: 900px;
    text-align: center;
}

.text-buffer p {
    font-family: var(--font-poppins);
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 400;
    line-height: 1.7;
    color: var(--primary-black);
}

/* Home Page Bestsellers Section */
.bestsellers-section {
    background-color: #1C1918;
    padding: 6rem 5% 8rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.bestsellers-section .section-header h2 {
    color: var(--primary-white);
    font-family: var(--font-display);
    font-size: 3rem;
    text-transform: uppercase;
}

.bestsellers-link-container {
    text-align: center;
    margin-top: 3.5rem;
}

.bestsellers-bottom-link {
    font-family: var(--font-poppins);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    color: var(--primary-white);
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-bottom: 1px solid transparent;
}

.bestsellers-bottom-link:hover {
    transform: scale(1.08);
    opacity: 0.9;
    border-bottom: 1px solid var(--primary-white);
}

/* Products */
.page-header { padding: 4rem 5% 2rem; text-align: center; }
.page-header h1 { font-family: var(--font-display); font-size: 3.5rem; text-transform: uppercase; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2.5rem; }
.product-card { background-color: var(--primary-white); border: 1px solid var(--soft-gray); border-radius: 12px; overflow: hidden; transition: box-shadow 0.3s; display: block; }
.product-card:hover { box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.product-image { 
    height: 350px; 
    background-size: 80%; 
    background-repeat: no-repeat; 
    background-position: center; 
    position: relative; 
}
.product-info { padding: 1.5rem; text-align: center; }
.product-info h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--primary-black); }
.product-info p { color: var(--text-gray); }

/* Specialty Coffee Section */
.specialty-section {
    padding: 7rem 5%;
    background-color: var(--primary-white);
    color: var(--primary-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.specialty-container {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.specialty-image {
    width: 100%;
    height: 480px;
    background: url('https://images.unsplash.com/photo-1514432324607-a09d9b4aefdd?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80') center/cover no-repeat;
    border-radius: 12px;
}

.specialty-content h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 3rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.specialty-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.specialty-badge-list {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
    border-top: 1px solid var(--soft-gray);
    padding-top: 2rem;
}

.specialty-badge h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

/* Reviews Carousel Section */
.reviews-section {
    background-color: #161312;
    padding: 7rem 0;
    color: var(--primary-white);
}
.reviews-header {
    text-align: center;
    margin-bottom: 3.5rem;
    padding: 0 5%;
}
.reviews-header h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    text-transform: uppercase;
}
.reviews-container-wrapper {
    position: relative;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 4rem;
}
.reviews-carousel {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding: 1rem 0 2rem;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.reviews-carousel::-webkit-scrollbar {
    display: none;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(40, 35, 33, 0.9);
    color: var(--primary-white);
    border: 1px solid #444;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s, transform 0.2s, border-color 0.3s;
    font-size: 1.2rem;
}
.carousel-btn:hover {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    transform: translateY(-50%) scale(1.08);
}
.prev-btn { left: 0; }
.next-btn { right: 0; }

.review-card {
    flex: 0 0 350px;
    scroll-snap-align: start;
    background-color: #201d1c;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.review-stars {
    color: #ff9900;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}
.review-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #d1d1d1;
    margin-bottom: 1.5rem;
    font-style: italic;
}
.review-author {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-white);
}

/* Mobile Responsiveness & Phone Optimization Media Queries */
@media (max-width: 900px) {
    .specialty-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .specialty-image {
        height: 350px;
    }
    .hero-link-container {
        transform: none;
        text-align: center;
    }
    .reviews-container-wrapper {
        padding: 0 2.5rem;
    }
    .carousel-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-right-col {
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0 4%;
        height: 72px;
    }
    .compound-icon-link img {
        height: 52px;
    }
    .header-middle .logo img {
        height: 160px;
    }
    .amazon-pill-btn {
        padding: 0.2rem 0.6rem;
    }
    .pill-top {
        font-size: 0.42rem;
    }
    .amazon-word {
        font-size: 0.9rem;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-link-container {
        margin-top: 2rem;
    }
    .text-buffer {
        padding: 4rem 4%;
    }
    .text-buffer p {
        font-size: 1.15rem;
    }
    .bestsellers-section {
        padding: 4rem 4%;
    }
    .bestsellers-section .section-header h2,
    .reviews-header h2,
    .specialty-content h2,
    .page-header h1 {
        font-size: 2.2rem;
    }
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .product-image {
        height: 280px;
    }
    .review-card {
        flex: 0 0 85vw;
        padding: 1.5rem;
    }
    .reviews-container-wrapper {
        padding: 0 2rem;
    }
}