/* recipes.php / recipe-detail.php / newOrder.php popup — Annam Organic Recipes
   Listing styles are scoped under .recipes-page, detail styles under .detail-wrap,
   popup styles under .rc-* so this sheet never overrides newOrder.php's own layout. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4f1d4 100%);
    min-height: 100vh;
    color: #1a4d1a;
    line-height: 1.6;
}

.container { width: 100%; }

/* ================= Recipes listing page (recipes.php) ================= */
.recipes-page {
    width: 100%;
    min-height: 100vh;
}

.recipes-page .main-container {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Mobile brand sidebar (categories) */
.recipes-page .mobile-brand-sidebar {
    width: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
    padding: 70px 6px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.recipes-page .mobile-brand-btn {
    width: 100%;
    background: #f0f9f0;
    border: 2px solid #c8e6c8;
    border-radius: 12px;
    padding: 6px 4px;
    font-size: 9px;
    font-weight: 600;
    color: #2d5016;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 45px;
}

.recipes-page .mobile-brand-btn.active {
    background: linear-gradient(135deg, #4a7c59, #2d5016);
    color: white;
    border-color: #2d5016;
}

.recipes-page .mobile-brand-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 1px 4px;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 700;
}

.recipes-page .sidebar { display: none; }

.recipes-page .content-area {
    flex: 1;
    margin-left: 70px;
    padding: 15px 10px;
    background: transparent;
}

.recipes-page .mobile-filter-area {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4f1d4 100%);
    flex: 1;
    margin-left: 70px;
    padding: 4px 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.recipes-page .mobile-filters-toggle {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    background: #4a7c59;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.recipes-page .mobile-filters {
    display: none;
    background: white;
    margin: 0 0 15px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.1);
}

.recipes-page .mobile-filters.active { display: block; }

.recipes-page .search-section { margin-bottom: 25px; }

.recipes-page .search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #c8e6c8;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    color: #2d5016;
}

.recipes-page .search-input:focus {
    outline: none;
    border-color: #4a7c59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.recipes-page .filter-section { margin-bottom: 25px; }
.recipes-page .filter-title { font-weight: 600; color: #2d5016; margin-bottom: 10px; font-size: 14px; }
.recipes-page .filter-group { margin-bottom: 15px; }
.recipes-page .checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.recipes-page .checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #2d5016; }

.recipes-page .content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.recipes-page .content-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a4d1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipes-page .results-info { color: #4a7c59; font-size: 13px; }

.recipes-page .select-input {
    padding: 8px 12px;
    border: 2px solid #c8e6c8;
    border-radius: 10px;
    font-size: 13px;
    background: white;
    color: #2d5016;
}

/* Recipe grid */
.recipes-page .products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 100px;
}

.recipes-page .product-card {
    background: white;
    border-radius: 16px;
    box-shadow:
        0 6px 12px rgba(74, 124, 89, 0.2),
        0 12px 24px rgba(74, 124, 89, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(74, 124, 89, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.recipes-page .product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a7c59, #2d5016);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.recipes-page .product-card:hover::before { opacity: 1; }
.recipes-page .product-card:active { transform: scale(0.98); }

.recipes-page .product-image { width: 100%; height: 100%; object-fit: cover; display: block; }

.recipes-page .product-image-wrapper {
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-bottom: 1px solid #e8f5e8;
    position: relative;
}

.recipes-page .product-image-wrapper.placeholder {
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 40%),
        linear-gradient(135deg, #f0f9f0, #d9ecd9);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.recipes-page .recipe-emoji {
    font-size: 64px;
    filter: drop-shadow(0 6px 12px rgba(45, 80, 22, 0.25));
    transition: transform 0.3s ease;
}

.recipes-page .product-card:hover .recipe-emoji { transform: scale(1.08) rotate(-3deg); }

.recipes-page .recipe-cat-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #2d5016;
    border: 1px solid #c8e6c8;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    z-index: 1;
}

.recipes-page .product-action-wrapper { padding: 12px; display: flex; flex-direction: column; flex: 1; }

.recipes-page .product-name { font-size: 14px; font-weight: 700; color: #1a4d1a; margin-bottom: 4px; line-height: 1.3; }

.recipes-page .product-description { display: block; font-size: 11px; color: #4a7c59; margin-bottom: 8px; line-height: 1.4; }

.recipes-page .recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 6px 0;
}

.recipes-page .meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: #e8f5e8;
    color: #2d5016;
    border: 1px solid #d4ead4;
}

.recipes-page .meta-badge.time { background: #eef7ee; color: #2d5016; }
.recipes-page .meta-badge.diff { background: #fff5e6; color: #b85c00; border-color: #ffe4b8; }

.recipes-page .ingredients-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 8px 0;
}

.recipes-page .ingredient-pill {
    flex: 0 0 auto;
    padding: 4px 9px;
    background: #f0f9f0;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    font-size: 10px;
    color: #4a7c59;
    text-align: center;
    transition: all 0.2s ease;
}

.recipes-page .ingredient-pill:hover { background: #2d5016; color: white; border-color: #2d5016; }
.recipes-page .ingredient-pill a { color: inherit; text-decoration: none; }

.recipes-page .product-controls { margin-top: auto; display: flex; flex-direction: row; gap: 8px; }

.recipes-page .add-btn {
    background: linear-gradient(135deg, #4a7c59, #2d5016);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.recipes-page .add-btn:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #2d5016, #1a4d1a);
}

.recipes-page .add-btn.outline {
    background: white;
    color: #2d5016;
    border: 2px solid #4a7c59;
}

.recipes-page .add-btn.outline:active { background: #f0f9f0; }

.recipes-page .empty-state { text-align: center; padding: 40px 20px; color: #4a7c59; grid-column: 1 / -1; }
.recipes-page .empty-state h3 { margin-bottom: 10px; font-size: 18px; color: #2d5016; }

/* Floating CTA (recipe pages only) */
.recipes-page .summary-floating-btn {
    position: fixed;
    bottom: 20px;
    left: 85px;
    right: 15px;
    background: linear-gradient(135deg, #4a7c59, #2d5016);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 8px 25px rgba(74, 124, 89, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.recipes-page .summary-floating-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 15px rgba(74, 124, 89, 0.4);
}

/* ================= Recipe detail page (recipe-detail.php) ================= */
.detail-wrap { max-width: 860px; margin: 0 auto; padding: 16px 14px 90px; }

.detail-wrap .detail-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-wrap .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #c8e6c8;
    color: #2d5016;
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.detail-wrap .back-btn:hover { background: #2d5016; color: white; }

.detail-wrap .top-actions { display: flex; gap: 8px; }

.detail-wrap .chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f9f0;
    border: 1px solid #c8e6c8;
    color: #2d5016;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.detail-wrap .chip-btn:hover { background: #2d5016; color: white; border-color: #2d5016; }

.detail-wrap .hero-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(74, 124, 89, 0.3);
    box-shadow:
        0 6px 12px rgba(74, 124, 89, 0.2),
        0 12px 24px rgba(74, 124, 89, 0.15);
    margin-bottom: 18px;
}

.detail-wrap .hero-image {
    height: 260px;
    background:
        radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 45%),
        linear-gradient(135deg, #f7e7c8 0%, #f9cf8e 50%, #f0a04b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.detail-wrap .hero-image.has-image { background: #e8f5e8; }
.detail-wrap .hero-image.has-image .hero-photo { width: 100%; height: 100%; object-fit: cover; }

.detail-wrap .hero-emoji { font-size: 110px; filter: drop-shadow(0 10px 20px rgba(120, 60, 10, 0.3)); }

.detail-wrap .hero-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: #2d5016;
    border: 1px solid #c8e6c8;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.detail-wrap .hero-body { padding: 22px; }

.detail-wrap .hero-title { font-size: 24px; font-weight: 800; color: #1a4d1a; margin-bottom: 6px; }
.detail-wrap .hero-subtitle { font-size: 14px; color: #4a7c59; margin-bottom: 16px; }
.detail-wrap .hero-subtitle b { color: #2d5016; }

.detail-wrap .meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 2px solid #e8f5e8;
}

.detail-wrap .meta-box {
    flex: 1 1 90px;
    background: #f0f9f0;
    border: 1px solid #d4ead4;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
}

.detail-wrap .meta-box .m-label { font-size: 10px; color: #4a7c59; text-transform: uppercase; letter-spacing: 0.3px; }
.detail-wrap .meta-box .m-value { font-size: 15px; font-weight: 800; color: #2d5016; margin-top: 2px; }

.detail-wrap .detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.detail-wrap .card-panel {
    background: white;
    border-radius: 18px;
    border: 1px solid rgba(74, 124, 89, 0.3);
    box-shadow:
        0 6px 12px rgba(74, 124, 89, 0.15),
        0 12px 24px rgba(74, 124, 89, 0.1);
    padding: 20px;
}

.detail-wrap .card-panel h3 {
    font-size: 17px;
    font-weight: 800;
    color: #1a4d1a;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8f5e8;
}

.detail-wrap .ingredient-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed #e8f5e8;
    font-size: 14px;
    color: #1a4d1a;
    cursor: pointer;
}

.detail-wrap .ingredient-item:last-child { border-bottom: none; }

.detail-wrap .ingredient-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2d5016;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.detail-wrap .ingredient-item.done { color: #4a7c59; text-decoration: line-through; }

.detail-wrap .ingredient-amount { color: #2d5016; font-weight: 700; margin-right: 4px; }

.detail-wrap .ing-order-link {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    color: #4a7c59;
    background: #f0f9f0;
    border: 1px solid #c8e6c8;
    border-radius: 12px;
    padding: 3px 10px;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}

.detail-wrap .ing-order-link:hover { background: #2d5016; color: white; border-color: #2d5016; }

.detail-wrap button.ing-order-link { font-family: inherit; cursor: pointer; }

.detail-wrap .ing-order-link.ing-oos {
    background: #f1f1f1;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
}

.detail-wrap .ing-order-link.ing-oos:hover { background: #f1f1f1; color: #999; border-color: #ddd; }

.detail-wrap .ing-phone-row { margin-top: 12px; }

.detail-wrap .ing-phone-row input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #c8e6c8;
    border-radius: 12px;
    font-size: 14px;
    color: #2d5016;
}

/* Auth modal (shared login/register flow, same as listing page) */
#authModal.cart-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#authModal .cart-modal {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    width: 100%;
}

#authModal .summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

#authModal .cart-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #1a4d1a;
}

#authModal .close-summary {
    background: none;
    border: none;
    font-size: 24px;
    color: #4a7c59;
    cursor: pointer;
}

#authModal .cart-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#authModal .cart-modal-actions button {
    width: 100%;
    border: none;
    border-radius: 15px;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
}

/* Floating cart balloon (count mirrors the shared engine cart) */
.rec-cart-balloon {
    position: fixed;
    bottom: 20px;
    left: 15px;
    right: 15px;
    background: linear-gradient(135deg, #4a7c59, #2d5016);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 8px 25px rgba(74, 124, 89, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 1000;
}

.rec-cart-count {
    background: rgba(255,255,255,0.3);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 14px;
}

@media (min-width: 768px) {
    .rec-cart-balloon {
        left: auto;
        right: 30px;
        bottom: 30px;
        width: auto;
    }
}

.detail-wrap .order-all-btn {
    width: 100%;
    margin-top: 16px;
    background: linear-gradient(135deg, #4a7c59, #2d5016);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.detail-wrap .order-all-btn:active {
    transform: translateY(2px);
    background: linear-gradient(135deg, #2d5016, #1a4d1a);
}

.detail-wrap .step-item {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
}

.detail-wrap .step-item:last-child { margin-bottom: 0; }

.detail-wrap .step-num {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4a7c59, #2d5016);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 3px 8px rgba(74, 124, 89, 0.3);
}

.detail-wrap .step-text { padding-top: 4px; font-size: 14px; color: #1a4d1a; }
.detail-wrap .step-text b { color: #2d5016; }

.detail-wrap .pro-tip {
    margin-top: 18px;
    background: #fff5e6;
    border: 1px solid #ffe4b8;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    color: #b85c00;
}
.detail-wrap .pro-tip b { color: #b85c00; }

.detail-wrap .related-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

.detail-wrap .related-card {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #f0f9f0;
    border: 1px solid #e8f5e8;
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.detail-wrap .related-card:hover { border-color: #4a7c59; background: #e8f5e8; }

.detail-wrap .related-emoji {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border: 1px solid #c8e6c8;
}

.detail-wrap .related-name { font-size: 14px; font-weight: 700; color: #1a4d1a; }
.detail-wrap .related-meta { font-size: 11px; color: #4a7c59; }

.detail-wrap .summary-floating-btn {
    position: fixed;
    bottom: 20px;
    left: 15px;
    right: 15px;
    background: linear-gradient(135deg, #4a7c59, #2d5016);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 8px 25px rgba(74, 124, 89, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

/* ================= Recipes popup (inside newOrder.php) ================= */
.rc-popup-product-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f0f9f0;
    border: 1px solid #c8e6c8;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 16px;
}

.rc-popup-product-emoji {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border: 1px solid #c8e6c8;
}

.rc-popup-product-img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #c8e6c8;
}

.rc-popup-product-name { font-size: 15px; font-weight: 700; color: #1a4d1a; }
.rc-popup-product-role { font-size: 11px; color: #4a7c59; margin-top: 2px; }

.rc-recipe-count { font-size: 13px; font-weight: 700; color: #2d5016; margin: 4px 0 12px; }

.rc-recipe-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid #e8f5e8;
    border-radius: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    background: white;
}

.rc-recipe-row:hover { background: #f0f9f0; border-color: #4a7c59; transform: translateX(3px); }

.rc-recipe-row-emoji {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 12px;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 45%),
        linear-gradient(135deg, #f0f9f0, #d9ecd9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.rc-recipe-row-info { flex: 1; min-width: 0; }
.rc-recipe-row-name { font-size: 14px; font-weight: 700; color: #1a4d1a; }
.rc-recipe-row-meta { font-size: 11px; color: #4a7c59; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 8px; }
.rc-recipe-row-arrow { font-size: 18px; color: #4a7c59; }

.rc-popup-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rc-popup-actions button { width: 100%; }

.rc-view-recipes-btn {
    width: 100%;
    flex-basis: 100%;
    margin-top: 8px;
    background: white;
    color: #2d5016;
    border: 2px solid #4a7c59;
    border-radius: 12px;
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rc-view-recipes-btn:hover { background: #2d5016; color: white; }
.rc-view-recipes-btn:active { transform: scale(0.95); }

/* Wrap for newOrder.php card controls so the recipes button drops to its own line */
.newOrder .product-controls { flex-wrap: wrap; }

.rc-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(21, 40, 18, 0.45);
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

.rc-popup {
    background: #f7fbf6;
    border-radius: 22px 22px 0 0;
    width: 100%;
    max-width: 720px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -12px 40px rgba(21, 40, 18, 0.25);
    animation: rcPopupIn 0.28s ease;
}

@keyframes rcPopupIn {
    from { transform: translateY(48px); opacity: 0.4; }
    to { transform: translateY(0); opacity: 1; }
}

.rc-popup-sub { font-size: 13px; color: #4a7c59; padding: 4px 16px 10px; }

.rc-popup-list {
    overflow-y: auto;
    padding: 4px 16px 16px;
    flex: 1 1 auto;
}

.rc-popup-all { padding: 14px 16px 20px; }

.rc-popup-all .cart-modal-btn-merge { display: block; }

.rc-recipe-img {
    object-fit: cover;
    width: 52px;
    height: 52px;
    border-radius: 12px;
}

/* ================= Responsive ================= */
/* Tablet */
@media (min-width: 768px) {
    .recipes-page .mobile-filter-area { display: none; }
    .recipes-page .main-container { flex-direction: row; padding: 20px; gap: 20px; max-width: 1400px; margin: 0 auto; }
    .recipes-page .mobile-brand-sidebar { display: none; }

    .recipes-page .sidebar {
        display: block;
        width: 300px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 20px;
        padding: 25px;
        box-shadow: 0 15px 40px rgba(74, 124, 89, 0.1);
        height: fit-content;
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        border: 1px solid #e8f5e8;
    }

    .recipes-page .sidebar h3 { color: #1a4d1a; margin-bottom: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
    .recipes-page .brand-list { list-style: none; }
    .recipes-page .brand-item { margin-bottom: 8px; }

    .recipes-page .brand-btn {
        width: 100%;
        padding: 12px 16px;
        background: transparent;
        border: none;
        border-radius: 12px;
        text-align: left;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 14px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #2d5016;
    }

    .recipes-page .brand-btn:hover { background: #f0f9f0; transform: translateX(5px); }
    .recipes-page .brand-btn.active { background: linear-gradient(135deg, #4a7c59, #2d5016); color: white; font-weight: 600; }
    .recipes-page .brand-count { background: rgba(255, 255, 255, 0.2); padding: 2px 8px; border-radius: 12px; font-size: 12px; }
    .recipes-page .brand-btn.active .brand-count { background: rgba(255, 255, 255, 0.3); }

    .recipes-page .content-area {
        flex: 1;
        margin-left: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 20px;
        padding: 30px;
        box-shadow: 0 15px 40px rgba(74, 124, 89, 0.1);
        border: 1px solid #e8f5e8;
    }

    .recipes-page .products-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
    .recipes-page .product-action-wrapper { padding: 20px; }
    .recipes-page .product-name { font-size: 16px; }
    .recipes-page .product-description { font-size: 13px; }
    .recipes-page .product-image-wrapper { height: 200px; }
    .recipes-page .recipe-emoji { font-size: 80px; }
    .recipes-page .ingredient-pill { font-size: 11px; padding: 5px 11px; }

    .recipes-page .summary-floating-btn { position: fixed; bottom: 30px; right: 30px; left: auto; width: auto; border-radius: 50px; }
}

/* Desktop */
@media (min-width: 1200px) {
    .recipes-page .products-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
    .recipes-page .product-name { font-size: 17px; }
    .recipes-page .product-image-wrapper { height: 220px; }
}

/* Detail page responsive overrides */
@media (min-width: 768px) {
    .detail-wrap { padding: 24px 20px 110px; }
    .detail-wrap .hero-image { height: 340px; }
    .detail-wrap .hero-emoji { font-size: 140px; }
    .detail-wrap .hero-title { font-size: 28px; }
    .detail-wrap .detail-grid { grid-template-columns: 1fr 1fr; align-items: start; }
    .detail-wrap .related-grid { grid-template-columns: 1fr; }
    .detail-wrap .summary-floating-btn { left: auto; right: 30px; width: auto; border-radius: 50px; }
}

@media (min-width: 900px) {
    .detail-wrap .related-grid { grid-template-columns: 1fr 1fr; }
}