/* 
  Cake Origin - Premium Bakery Website
  Theme: Modern, Bright, Red & White
*/

:root {
    --primary-color: #E31E24;
    /* Cake Origin Red */
    --primary-dark: #B71C1C;
    --secondary-color: #F48FB1;
    /* Balloon Pink */
    --accent-color: #FFEBEE;
    /* Light Pink Background */
    --text-dark: #1A1A1A;
    --text-gray: #666666;
    --white: #FFFFFF;
    --bg-light: #F9F9F9;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --transition: all 0.3s ease;

    /* Fonts */
    --font-body: 'Poppins', sans-serif;
    --font-heading: 'Playfair Display', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    /* Remove blue highlight on mobile tap */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: var(--font-body);
}

/* --- Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.grid {
    display: grid;
}

.hidden {
    display: none !important;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
    /* Prevent text wrap */
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo span {
    color: var(--text-dark);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark);
    position: relative;
    font-size: 1rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.icon-btn {
    background: none;
    font-size: 1.2rem;
    color: var(--text-dark);
    position: relative;
    padding: 5px;
    /* Increase tap area */
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    padding: 10px;
    order: 3;
    /* Ensure it's on the right in mobile view logic if needed */
}

/* --- Hero Section --- */
.hero {
    padding-top: 120px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #fff 100%);
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 30px;
}

.hero-image {
    position: relative;
}

.hero-image img {
    border-radius: 50%;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    animation: float 6s ease-in-out infinite;
    background-color: #fff;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* --- Features / Why Choose Us --- */
.features {
    background-color: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    border-radius: var(--radius);
    background-color: var(--bg-light);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
    background-color: var(--white);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* --- Best Sellers / Products --- */
.products-section {
    background-color: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-image {
    height: 250px;
    /* fallback */
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
}

.badge-stock {
    background-color: #4CAF50;
    color: white;
}

.badge-out {
    background-color: #f44336;
    color: white;
}

.badge-eggless {
    background-color: #009688;
    color: white;
    position: absolute;
    top: 15px;
    right: 10px;
    left: auto;
}

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.85rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 1.25rem;
    margin: 5px 0 10px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    /* Push to bottom */
}

.product-price {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.btn-add-cart {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    background-color: var(--text-dark);
    color: var(--white);
    transition: var(--transition);
}

.btn-add-cart:hover {
    background-color: var(--primary-color);
}

.btn-add-cart:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* --- Cart Drawer --- */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: var(--white);
    z-index: 1002;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.cart-open .cart-overlay {
    opacity: 1;
    visibility: visible;
}

.cart-open .cart-drawer {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 1.5rem;
}

.close-cart {
    font-size: 1.5rem;
    background: none;
    padding: 10px;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 500;
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background-color: var(--bg-light);
    /* Ensure padding for mobile bottom bar */
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.btn-checkout {
    width: 100%;
    border-radius: var(--radius);
}

/* --- Payment Modal (GPay) --- */
.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    /* Prevent edge touching on mobile */
}

.payment-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.payment-modal {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transform: translateY(20px);
    transition: all 0.3s ease;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.payment-modal-overlay.active .payment-modal {
    transform: translateY(0);
}

.payment-header h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.payment-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 30px;
}

.gpay-btn {
    width: 100%;
    background: #000;
    color: white;
    height: 50px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid #333;
    margin-bottom: 20px;
}

.gpay-btn:hover {
    transform: scale(1.02);
    background: #111;
}

.gpay-btn i {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Payment Form Styles */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(227, 30, 36, 0.1);
}

.payment-status {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
    min-height: 20px;
}

.close-payment {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    /* Larger touch target */
    cursor: pointer;
    color: #999;
    padding: 10px;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Footer --- */
footer {
    background-color: var(--text-dark);
    color: var(--white);
    padding-top: 60px;
    padding-bottom: 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #ccc;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.social-icon:hover {
    background: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 0.9rem;
}

/* =========================================
   📱 MOBILE RESPONSIVE OVERRIDES
   ========================================= */

/* Tablet & Smaller (991px and down) */
@media (max-width: 991px) {
    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-content {
        order: 2;
    }

    .hero-image {
        order: 1;
        margin: 0 auto;
        max-width: 400px;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .navbar .container {
        padding: 0 30px;
    }
}

/* Mobile (768px and down) */
@media (max-width: 768px) {

    /* Navbar */
    .mobile-toggle {
        display: block;
        z-index: 1002;
    }

    .badge-eggless {
        background-color: #009688;
        color: white;
        position: absolute;
        width: 60px;
        top: 15px;
        left: auto;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        /* Don't cover fully to show context */
        max-width: 300px;
        height: 100vh;
        background-color: var(--white);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 100px;
        padding-left: 30px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 1001;
        /* Above hero but below close btn if separate */
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 15px 0;
        width: 100%;
    }

    .nav-links li a {
        display: block;
        font-size: 1.1rem;
        padding: 5px 0;
    }

    /* Overlay for menu when active */
    .nav-links.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        /* will cover everything */
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        pointer-events: none;
        /* simple backdrop, usually needs JS to click-close */
    }

    .nav-icons {
        gap: 15px;
        margin-right: 10px;
    }

    /* Typography Sizing */
    h1 {
        font-size: 2.2rem !important;
    }

    h2 {
        font-size: 1.8rem !important;
    }

    .section-header p {
        font-size: 0.9rem;
        margin-top: 5px;
    }

    /* Hero */
    .hero {
        padding-top: 100px;
        padding-bottom: 50px;
    }

    .hero-image {
        max-width: 300px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    /* Feature Grid - 1 Col on phone for icon impact */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Products - 2 Columns on Mobile for E-commerce Standard */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-card {
        border-radius: 8px;
    }

    .product-image {
        height: 160px;
    }

    .product-info {
        padding: 12px;
    }

    .product-title {
        font-size: 1rem;
        margin-bottom: 5px;
    }

    .product-price {
        font-size: 1rem;
    }

    .btn-add-cart {
        padding: 6px 10px;
        font-size: 0.8rem;
        width: 100%;
        margin-top: 5px;
    }

    .badge {
        font-size: 0.7rem;
        padding: 3px 8px;
        top: 10px;
        left: 10px;
    }

    /* Cart Drawer - Full Width */
    .cart-drawer {
        width: 100%;
        max-width: 100%;
        right: -100%;
    }

    /* Filter Buttons - Horizontal Scroll */
    .filter-btn-container {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        display: flex;
        gap: 10px;
    }
}

/* Very Small Mobile (380px and down) */
@media (max-width: 380px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    /* 1 col for very narrow screens */
    .hero-content h1 {
        font-size: 2rem;
    }
}