/* 
===================================================
Project: Premium Cafe Website (Demo to PHP Ready)
Description: Modular CSS for frontend, ready for
component-based separation later.
===================================================
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* --- CSS VARIABLES (Design System) --- */
:root {
    /* Colors */
    --c-primary: #af8f6f;
    /* Gold/Brown accent */
    --c-primary-hover: #96785a;
    --c-secondary: #543310;
    /* Dark Brown */
    --c-bg-light: #f8f4e6;
    /* Cream */
    --c-bg-alt: #f1ebd8;
    /* Beige */
    --c-text-main: #222222;
    /* Anthracite / Black */
    --c-text-light: #666666;
    /* Light gray for paragraphs */
    --c-white: #ffffff;
    --c-dark: #1a1a1a;

    /* Fonts */
    --f-heading: 'Playfair Display', serif;
    --f-body: 'Inter', sans-serif;

    /* Utilities */
    --radius: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --shadow-gold: 0 8px 24px rgba(175, 143, 111, 0.2);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- RESET & BASIC SETUP --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--f-body);
    color: var(--c-text-main);
    background-color: var(--c-bg-light);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--f-heading);
    color: var(--c-secondary);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--f-body);
    outline: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- SECTION PADDING --- */
.section {
    padding: 100px 0;
}

.section-light {
    background-color: var(--c-white);
}

.section-dark {
    background-color: var(--c-dark);
    color: var(--c-white);
}

.section-dark h2,
.section-dark p {
    color: var(--c-white);
}

.section-alt {
    background-color: var(--c-bg-alt);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-title p {
    color: var(--c-text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.section-dark .section-title p {
    color: #cccccc;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-weight: 600;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 1rem;
    letter-spacing: 0.5px;
    gap: 8px;
}

.btn-primary {
    background-color: var(--c-primary);
    color: var(--c-white);
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    background-color: var(--c-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(175, 143, 111, 0.3);
    color: var(--c-white);
}

.btn-outline {
    border: 1.5px solid var(--c-primary);
    color: var(--c-primary);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--c-primary);
    color: var(--c-white);
}

.btn-white {
    background-color: var(--c-white);
    color: var(--c-secondary);
}

.btn-white:hover {
    background-color: var(--c-bg-light);
    transform: translateY(-3px);
}

/* --- HEADER / NAVIGATION (PHP INCLUDE CANDIDATE) --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.0);
    padding: 20px 0;
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--f-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--c-white);
    transition: var(--transition);
    letter-spacing: 1px;
}

.logo span {
    color: var(--c-primary);
}

.header.scrolled .logo {
    color: var(--c-secondary);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--c-white);
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background-color: var(--c-primary);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.header.scrolled .nav-links a {
    color: var(--c-text-main);
}

.header.scrolled .nav-links a:hover {
    color: var(--c-primary);
}

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--c-white);
}

.header.scrolled .mobile-toggle {
    color: var(--c-text-main);
}

/* --- HERO SECTION --- */
.hero {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1554118811-1e0d58224f24?q=80&w=2047&auto=format&fit=crop') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--c-white);
    position: relative;
}

.hero-content {
    max-width: 800px;
    padding: 0 20px;
    animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
    font-size: 5rem;
    margin-bottom: 20px;
    color: var(--c-white);
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    color: #e0e0e0;
    font-weight: 300;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* --- ABOUT PREVIEW SECTION --- */
.about-preview {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-img {
    flex: 1;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.about-img img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    transition: transform 0.8s ease;
}

.about-img:hover img {
    transform: scale(1.05);
}

.about-img::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    bottom: 20px;
    left: 20px;
    border: 2px solid var(--c-primary);
    border-radius: var(--radius-lg);
    z-index: -1;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    font-size: 2.8rem;
    margin-bottom: 25px;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--c-text-light);
    font-size: 1.05rem;
}

/* --- PRODUCT CARDS (PHP DYNAMIC RENDER EXPECTED) --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--c-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.product-img {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .product-img img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--c-primary);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.product-info {
    padding: 25px;
    text-align: center;
}

.product-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--c-secondary);
}

.product-desc {
    color: var(--c-text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: 20px;
}

/* --- FEATURES SECTION --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.feature-box {
    text-align: center;
    padding: 40px 20px;
    background: var(--c-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: var(--c-bg-light);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--c-primary);
    font-size: 30px;
}

.feature-box h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature-box p {
    color: var(--c-text-light);
    font-size: 0.95rem;
}

/* --- TESTIMONIALS --- */
.testimonials-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding-bottom: 20px;
    scrollbar-width: none;
}

.testimonials-slider::-webkit-scrollbar {
    display: none;
}

.testimonial-card {
    min-width: 350px;
    background: var(--c-white);
    padding: 30px;
    border-radius: var(--radius-lg);
    scroll-snap-align: start;
    box-shadow: var(--shadow-sm);
}

.stars {
    color: #f59e0b;
    margin-bottom: 15px;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 20px;
    color: var(--c-text-main);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info h4 {
    font-family: var(--f-body);
    font-size: 1rem;
    color: var(--c-secondary);
    margin: 0;
}

.author-info p {
    font-size: 0.8rem;
    margin: 0;
    color: var(--c-text-light);
}

/* --- CTA SECTION --- */
.cta-section {
    background: linear-gradient(rgba(84, 51, 16, 0.9), rgba(84, 51, 16, 0.9)), url('https://images.unsplash.com/photo-1497935586351-b67a49e012bf?q=80&w=2071&auto=format&fit=crop') center/cover fixed;
    color: white;
    text-align: center;
    padding: 120px 0;
}

.cta-section h2 {
    color: white;
    font-size: 3rem;
    margin-bottom: 20px;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

/* --- FOOTER (PHP INCLUDE CANDIDATE) --- */
.footer {
    background-color: var(--c-dark);
    color: white;
    padding: 80px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand .logo {
    margin-bottom: 20px;
    display: inline-block;
}

.footer-brand p {
    color: #aaaaaa;
    margin-bottom: 20px;
    max-width: 300px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--c-primary);
    transform: translateY(-3px);
}

.footer-col h4 {
    color: white;
    font-family: var(--f-body);
    font-size: 1.1rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background: var(--c-primary);
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #aaaaaa;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--c-primary);
    padding-left: 5px;
}

.footer-contact li {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    color: #aaaaaa;
    align-items: flex-start;
}

.footer-contact li i {
    color: var(--c-primary);
    margin-top: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: #777777;
    font-size: 0.9rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-family: var(--f-body);
    outline: none;
    transition: var(--transition);
    background: var(--c-bg-light);
}

.form-control:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(175, 143, 111, 0.1);
    background: white;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Page Header */
.page-header {
    background: var(--c-secondary);
    padding: 150px 0 80px;
    text-align: center;
    color: white;
}

.page-header h1 {
    color: white;
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #aaa;
}

.breadcrumb li a {
    color: var(--c-primary);
}

.breadcrumb li::after {
    content: '/';
    margin-left: 10px;
}

.breadcrumb li:last-child::after {
    display: none;
}

/* Filters */
.filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 30px;
    background: white;
    border: 1px solid #ddd;
    font-weight: 500;
    color: var(--c-text-main);
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--c-primary);
    color: white;
    border-color: var(--c-primary);
}

/* Helpers */
.text-center {
    text-align: center;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

/* Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--c-bg-light);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(175, 143, 111, 0.3);
    border-radius: 50%;
    border-top-color: var(--c-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Back to Top */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--c-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    background: var(--c-secondary);
    transform: translateY(-5px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 3.5rem;
    }

    .about-preview {
        flex-direction: column;
        text-align: center;
    }

    .about-text .section-title {
        text-align: center !important;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding: 80px 0;
    }

    .about-img img {
        height: 400px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--c-white);
        flex-direction: column;
        justify-content: center;
        padding: 50px;
        box-shadow: var(--shadow-lg);
        transition: right 0.4s ease;
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        color: var(--c-text-main) !important;
        font-size: 1.2rem;
    }

    .mobile-toggle {
        display: block;
        z-index: 1001;
    }

    .header.scrolled {
        background: var(--c-white);
    }

    .header.scrolled .logo {
        color: var(--c-secondary);
    }

    .header.scrolled .mobile-toggle {
        color: var(--c-text-main);
    }

    .header .logo {
        color: var(--c-secondary);
        font-size: 1.5rem;
    }

    .nav-actions .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-btns {
        flex-direction: column;
        gap: 15px;
    }

    .hero-btns .btn {
        width: 100%;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-contact li {
        justify-content: center;
    }

    .page-header {
        padding: 120px 0 60px;
    }

    .page-header h1 {
        font-size: 2.2rem;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        margin-bottom: 40px;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .about-img img {
        height: 300px;
    }

    .about-text h2 {
        font-size: 2rem;
    }

    .cta-section {
        padding: 80px 20px;
    }

    .cta-section h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .nav-actions .btn {
        display: none;
    }

    /* Hide only on very tiny screens if overlapping */
}