/* =====================================================
   La Flor del Café – Custom Theme
   ===================================================== */

:root {
    --espresso:     #1A0A00;
    --coffee-dark:  #3D1A00;
    --coffee:       #6F4E37;
    --latte:        #C4A882;
    --cream:        #FFF8F0;
    --cream-dark:   #F5EDE0;
    --gold:         #C8963E;
    --gold-light:   #F0C060;
    --green:        #2D6A4F;
    --green-light:  #40916C;
    --green-dark:   #1B4332;
    --gray-warm:    #6B5B45;
    --border:       #E8DDD3;
    --white:        #FFFFFF;
    --danger:       #DC3545;
    --shadow-sm:    0 2px 8px rgba(26,10,0,.08);
    --shadow-md:    0 4px 20px rgba(26,10,0,.12);
    --shadow-lg:    0 8px 40px rgba(26,10,0,.16);
    --radius:       12px;
    --radius-sm:    8px;
    --transition:   .25s ease;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Lato', 'Segoe UI', sans-serif;
    background: var(--cream);
    color: var(--espresso);
    line-height: 1.6;
    font-size: 16px;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }

img { max-width: 100%; height: auto; }

/* ── Top bar ── */
.topbar {
    background: var(--espresso);
    color: rgba(255,255,255,.75);
    font-size: .82rem;
    letter-spacing: .02em;
}
.topbar a { color: rgba(255,255,255,.75); }
.topbar a:hover { color: #fff; }

/* ── Site Header ── */
.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--cream-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.logo-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--gold);
    flex-shrink: 0;
}

.brand-name {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: var(--coffee-dark) !important;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
}
.brand-name:hover { color: var(--green) !important; }

/* ── Search ── */
.search-bar { position: relative; }

.search-input {
    border: 2px solid var(--border);
    border-radius: 50px 0 0 50px !important;
    padding: .5rem 1.2rem;
    font-size: .95rem;
    background: var(--cream);
    transition: border-color var(--transition);
}
.search-input:focus {
    border-color: var(--green);
    box-shadow: none;
    background: var(--white);
}

.btn-search {
    background: var(--green);
    color: var(--white);
    border: 2px solid var(--green);
    border-radius: 0 50px 50px 0 !important;
    padding: .5rem 1.2rem;
    transition: background var(--transition);
}
.btn-search:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }

.search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 48px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 200;
    display: none;
    max-height: 320px;
    overflow-y: auto;
}
.search-suggestions.open { display: block; }

.suggestion-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--cream-dark);
    transition: background var(--transition);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--cream); }
.suggestion-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.suggestion-item .name { font-weight: 600; font-size: .9rem; }
.suggestion-item .price { font-size: .82rem; color: var(--green); }

/* ── Cart link ── */
.cart-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--espresso) !important;
    padding: .4rem .8rem;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    transition: all var(--transition);
    flex-shrink: 0;
}
.cart-link:hover {
    border-color: var(--green);
    background: var(--cream);
}

.cart-icon-wrap { position: relative; }

.cart-badge {
    position: absolute;
    top: -10px;
    right: -12px;
    background: var(--green);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: .7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cart-amount {
    font-weight: 700;
    color: var(--green);
    font-size: .95rem;
}

/* ── Category Nav ── */
.category-nav {
    background: var(--green);
    padding: .5rem 0;
    position: sticky;
    top: 110px;
    z-index: 999;
}

.category-scroll {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.cat-btn {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: .35rem .9rem;
    border-radius: 50px;
    font-size: .88rem;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    transition: all var(--transition);
    border: 2px solid transparent;
}
.cat-btn:hover,
.cat-btn.active {
    background: var(--white);
    color: var(--green-dark);
    border-color: var(--white);
}

/* ── Main Content ── */
.main-content {
    min-height: 60vh;
    padding-bottom: 3rem;
}

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, var(--coffee-dark) 0%, var(--green-dark) 60%, var(--espresso) 100%);
    color: var(--white);
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    text-shadow: 0 2px 12px rgba(0,0,0,.3);
    margin-bottom: .5rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    opacity: .9;
    font-weight: 300;
}

.hero-cta {
    background: var(--gold);
    color: var(--espresso);
    font-weight: 700;
    padding: .75rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    transition: all var(--transition);
    border: none;
    display: inline-block;
}
.hero-cta:hover {
    background: var(--gold-light);
    color: var(--espresso);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200,150,62,.4);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50px;
    padding: .35rem 1rem;
    font-size: .85rem;
    backdrop-filter: blur(4px);
}

/* ── Category Cards (home showcase) ── */
.category-cards { padding: 3rem 0; }

.cat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
    display: block;
    color: var(--espresso) !important;
}
.cat-card:hover {
    border-color: var(--green);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    color: var(--green-dark) !important;
}

.cat-card-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--green), var(--green-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.6rem;
    color: var(--white);
}

.cat-card-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
}

/* ── Section Titles ── */
.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--coffee-dark);
    position: relative;
    padding-bottom: .75rem;
    margin-bottom: 1.5rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--green), var(--gold));
    border-radius: 2px;
}
.section-title.center::after { left: 50%; transform: translateX(-50%); }

/* ── Breadcrumb ── */
.breadcrumb-wrap {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: .6rem 0;
}
.breadcrumb { margin: 0; font-size: .88rem; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--latte); }
.breadcrumb-item a { color: var(--green); }
.breadcrumb-item.active { color: var(--gray-warm); }

/* ── Product Grid ── */
.products-section { padding: 2rem 0; }

.products-grid { display: grid; gap: 1.25rem; }
.products-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.products-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 991px) { .products-grid.grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) {
    .products-grid.grid-3,
    .products-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
    .products-grid.grid-3,
    .products-grid.grid-2 { grid-template-columns: 1fr; }
}

/* ── Product Card ── */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--green-light);
}

.product-img-wrap {
    position: relative;
    padding-top: 72%;
    background: var(--cream-dark);
    overflow: hidden;
    flex-shrink: 0;
}
.product-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.06); }

.product-badge {
    position: absolute;
    top: .6rem;
    left: .6rem;
    background: var(--green);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.product-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--coffee-dark);
    margin-bottom: .3rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-qty {
    font-size: .78rem;
    color: var(--latte);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .25rem;
}

.product-desc {
    font-size: .85rem;
    color: var(--gray-warm);
    line-height: 1.45;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .75rem;
}

.product-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--green);
    margin-bottom: .75rem;
}

.product-footer {
    padding: .75rem 1rem;
    background: var(--cream);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.qty-input {
    width: 60px;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .3rem .4rem;
    font-size: .9rem;
    font-weight: 700;
    color: var(--espresso);
    background: var(--white);
    transition: border-color var(--transition);
}
.qty-input:focus { border-color: var(--green); outline: none; }

.btn-add {
    flex: 1;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: .45rem .75rem;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.btn-add:hover { background: var(--green-dark); transform: scale(1.02); }
.btn-add:active { transform: scale(.98); }
.btn-add.adding { background: var(--gold); }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--latte);
}
.empty-state i { font-size: 4rem; opacity: .5; margin-bottom: 1rem; }
.empty-state h3 { color: var(--gray-warm); font-family: 'Playfair Display', serif; }

/* ── Cart Page ── */
.cart-table-wrap {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.cart-table { margin: 0; }
.cart-table th {
    background: var(--cream-dark);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-warm);
    padding: .75rem 1rem;
    border-color: var(--border);
}
.cart-table td { padding: .75rem 1rem; vertical-align: middle; border-color: var(--border); }
.cart-table tr:last-child td { border-bottom: none; }

.cart-item-img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); }

.cart-summary {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: sticky;
    top: 160px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-total { font-size: 1.25rem; font-weight: 800; color: var(--green); }

.btn-checkout {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: .9rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.btn-checkout:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45,106,79,.35);
    color: #fff;
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
    border-radius: var(--radius-sm);
    padding: .4rem 1rem;
    font-size: .85rem;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-danger-outline:hover { background: var(--danger); color: #fff; }

/* ── Checkout Form ── */
.checkout-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.checkout-section h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--coffee-dark);
    margin-bottom: 1.25rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--cream-dark);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.form-label {
    font-weight: 600;
    font-size: .88rem;
    color: var(--gray-warm);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .3rem;
}

.form-control, .form-select {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .6rem 1rem;
    font-size: .95rem;
    background: var(--cream);
    transition: border-color var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(45,106,79,.12);
    background: var(--white);
}

.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { font-size: .82rem; }

.payment-option {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.payment-option:hover { border-color: var(--green-light); background: var(--cream); }
.payment-option.selected { border-color: var(--green); background: rgba(45,106,79,.06); }

.payment-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.payment-icon.sinpe { background: #FFDD00; color: #000; }
.payment-icon.tarjeta { background: var(--green); color: #fff; }

.btn-pay {
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: .9rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
}
.btn-pay:hover { background: var(--green-dark); transform: translateY(-2px); color: #fff; }

/* ── Product Detail Page ── */
.product-detail-img {
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

.product-detail-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--green);
}

.product-detail-qty {
    display: inline-flex;
    align-items: center;
    background: var(--cream-dark);
    border: 2px solid var(--border);
    border-radius: 50px;
    overflow: hidden;
}
.qty-btn {
    background: none;
    border: none;
    padding: .4rem .9rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--green);
    transition: background var(--transition);
}
.qty-btn:hover { background: var(--green); color: #fff; }
.qty-display {
    padding: .4rem .8rem;
    font-weight: 700;
    font-size: 1rem;
    min-width: 3rem;
    text-align: center;
    border: none;
    background: transparent;
}

/* ── Toast ── */
.toast-container { z-index: 1090; }

.toast-custom {
    background: var(--espresso);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
}
.toast-custom .toast-header {
    background: var(--green);
    color: var(--white);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.toast-custom .btn-close { filter: invert(1); }

/* ── Footer ── */
.site-footer {
    background: var(--espresso);
    color: rgba(255,255,255,.75);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-brand {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--gold);
    margin-bottom: .5rem;
}

.footer-desc {
    font-size: .88rem;
    opacity: .75;
    line-height: 1.7;
}

.footer-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--gold);
    margin-bottom: 1rem;
}

.footer-link {
    display: block;
    color: rgba(255,255,255,.65);
    font-size: .88rem;
    padding: .2rem 0;
    transition: color var(--transition);
}
.footer-link:hover { color: var(--white); }

.footer-contact {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: rgba(255,255,255,.75);
    font-size: .9rem;
    margin-bottom: .6rem;
}
.footer-contact i { color: var(--gold); width: 18px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 1.25rem;
    margin-top: 2rem;
    font-size: .82rem;
    opacity: .55;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.75);
    font-size: 1rem;
    transition: all var(--transition);
}
.social-btn:hover { background: var(--green); color: #fff; }

/* ── Success pages ── */
.success-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border-top: 5px solid var(--green);
}
.success-icon {
    font-size: 4rem;
    color: var(--green);
    margin-bottom: 1rem;
}
.sinpe-box {
    background: #FFDD00;
    color: var(--espresso);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    font-size: 1.1rem;
    font-weight: 700;
}

/* ── Utilities ── */
.text-green   { color: var(--green) !important; }
.text-gold    { color: var(--gold) !important; }
.text-coffee  { color: var(--coffee) !important; }
.bg-cream     { background: var(--cream) !important; }
.bg-espresso  { background: var(--espresso) !important; }

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mobile tweaks ── */
@media (max-width: 767px) {
    .site-header .container > div { gap: .75rem; }
    .brand-name { font-size: 1.5rem; }
    .logo-img { width: 52px; height: 52px; }
    .cart-amount { display: none; }
    .cart-link small { display: none; }
    .topbar .d-flex > small:last-child { display: none; }
    .category-nav { top: 88px; }
}

@media (max-width: 575px) {
    .hero { padding: 2.5rem 0 2rem; }
    .hero-title { font-size: 2rem; }
    .product-card { font-size: .9rem; }
    .category-nav { top: 82px; }
}
