/* ===== Product Detail Modal (Uber Eats / Rappi / DiDi Food style) ===== */

/* Overlay */
.pd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.pd-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Modal container */
.pd-modal {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.pd-overlay.open .pd-modal {
    transform: translateY(0);
}

/* Close button */
.pd-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    backdrop-filter: blur(4px);
    transition: background 0.15s;
}
.pd-close:hover { background: #fff; }

/* Scrollable content */
.pd-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ── Hero image ── */
.pd-hero {
    height: 240px;
    background: #f3f4f6;
    overflow: hidden;
    position: relative;
}
.pd-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pd-hero-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #d1d5db;
}

/* ── Product info ── */
.pd-info {
    padding: 20px 20px 12px;
}
.pd-info h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #111;
    margin: 0 0 4px;
    line-height: 1.2;
}
.pd-desc {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 12px;
}
.pd-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.pd-base-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #16a34a;
}
.pd-type-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pd-type-tag i { font-size: 0.6rem; }
.pd-type-tag.specialty { background: #fef9c3; color: #854d0e; }
.pd-type-tag.custom { background: #dbeafe; color: #1e40af; }
.pd-type-tag.combo { background: #f3e8ff; color: #7c3aed; }

/* ── Sections ── */
.pd-section {
    padding: 16px 20px;
    border-top: 8px solid #f3f4f6;
}
.pd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.pd-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pd-section-title i { color: #16a34a; font-size: 0.85rem; }
.pd-section-desc {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0 0 12px;
    line-height: 1.4;
}

/* Tags: Required / Optional / Info */
.pd-required-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #fef2f2;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.pd-optional-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: #f3f4f6;
    color: #6b7280;
    flex-shrink: 0;
}
.pd-info-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #dcfce7;
    color: #166534;
    flex-shrink: 0;
}

/* ── Progress bar (pick status) ── */
.pd-pick-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.pd-pick-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}
.pd-pick-fill {
    height: 100%;
    background: #16a34a;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.pd-pick-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}
.pd-pick-text i { color: #16a34a; }

/* ── Size selector ── */
.pd-sizes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pd-size-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.pd-size-option:hover { border-color: #86efac; }
.pd-size-option.selected {
    border-color: #16a34a;
    background: #f0fdf4;
}
.pd-size-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
}
.pd-size-radio.checked { border-color: #16a34a; }
.pd-size-radio.checked::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #16a34a;
}
.pd-size-info { flex: 1; }
.pd-size-info strong {
    display: block;
    font-size: 0.88rem;
    color: #111;
}
.pd-size-info span {
    font-size: 0.75rem;
    color: #9ca3af;
}
.pd-size-price {
    font-size: 1rem;
    font-weight: 700;
    color: #16a34a;
    flex-shrink: 0;
}

/* ── Included ingredients (read-only tags) ── */
.pd-included-ings {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pd-ing-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.pd-ing-tag.included {
    background: #dcfce7;
    color: #166534;
}
.pd-ing-tag.included i { font-size: 0.7rem; }
.pd-ing-tag.included small { font-weight: 400; opacity: 0.7; }

/* ── Ingredient grid (interactive rows) ── */
.pd-ing-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.pd-ing-cat-header {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 0 6px;
    border-bottom: 1px solid #f3f4f6;
}
.pd-ing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    border-bottom: 1px solid #f9fafb;
    cursor: pointer;
    transition: background 0.12s;
    border-radius: 8px;
    margin: 0 -4px;
    padding-left: 8px;
    padding-right: 8px;
}
.pd-ing-row:hover { background: #f9fafb; }
.pd-ing-row.selected { background: #f0fdf4; }
.pd-ing-row.premium.selected { background: #fefce8; }
.pd-ing-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.pd-ing-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: #374151;
}
.pd-premium-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: #fef9c3;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.pd-ing-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.pd-ing-price {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
}
.pd-ing-price.free { color: #16a34a; }
.pd-ing-toggle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #d1d5db;
    transition: all 0.15s;
    flex-shrink: 0;
}
.pd-ing-toggle.on {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}
.pd-ing-row.premium .pd-ing-toggle.on {
    background: #eab308;
    border-color: #eab308;
}

/* ── Double ingredient counter ── */
.pd-ing-counter {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 20px;
    padding: 2px;
}
.pd-cnt-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #16a34a;
    color: #fff;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.pd-cnt-btn:hover { background: #15803d; }
.pd-cnt-btn:active { transform: scale(0.9); }
.pd-cnt-num {
    min-width: 22px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #166534;
}
.pd-ing-row.premium .pd-ing-counter {
    background: #fefce8;
    border-color: #fde68a;
}
.pd-ing-row.premium .pd-cnt-btn {
    background: #eab308;
}
.pd-ing-row.premium .pd-cnt-btn:hover { background: #ca8a04; }
.pd-ing-row.premium .pd-cnt-num { color: #854d0e; }

.pd-ing-qty-badge {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
}
.pd-ing-row.premium .pd-ing-qty-badge {
    background: #fef9c3;
    color: #854d0e;
}

/* ── Notes textarea ── */
.pd-notes {
    width: 100%;
    min-height: 60px;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: inherit;
    color: #374151;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
}
.pd-notes:focus { border-color: #16a34a; }
.pd-notes::placeholder { color: #9ca3af; }

/* ── Quantity ── */
.pd-qty-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pd-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}
.pd-qty-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #f9fafb;
    font-size: 0.85rem;
    cursor: pointer;
    color: #374151;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-qty-btn:hover { background: #f3f4f6; }
.pd-qty-btn:disabled { opacity: 0.3; cursor: default; }
.pd-qty-num {
    width: 44px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
}

/* ── Sticky footer ── */
.pd-footer {
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
.pd-add-btn {
    width: 100%;
    padding: 15px 20px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s, transform 0.1s;
}
.pd-add-btn:hover { background: #15803d; }
.pd-add-btn:active { transform: scale(0.98); }
.pd-add-price {
    font-size: 1.05rem;
    font-weight: 800;
}

/* ── Menu card subtag ── */
.menu-card-subtag {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #16a34a;
    background: #f0fdf4;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ── Product choice options (combo slots: refresco, complemento) ── */
.pd-product-choices {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.pd-choice-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.12s;
    border-radius: 8px;
    margin: 0 -4px;
}
.pd-choice-option:hover { background: #f9fafb; }
.pd-choice-option.selected { background: #f0fdf4; }
.pd-choice-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.pd-choice-radio.checked {
    border-color: #16a34a;
    background: #16a34a;
}
.pd-choice-radio.checked::after {
    content: '✓';
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
}
.pd-choice-img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.pd-choice-placeholder {
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1rem;
}
.pd-choice-info {
    flex: 1;
    min-width: 0;
}
.pd-choice-info strong {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1f2937;
}
.pd-choice-price {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    flex-shrink: 0;
}
.pd-choice-price.free {
    color: #16a34a;
}

/* ── Desktop: center modal ── */
@media (min-width: 600px) {
    .pd-overlay { align-items: center; }
    .pd-modal {
        border-radius: 20px;
        max-height: 85vh;
        transform: translateY(30px);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .pd-overlay.open .pd-modal {
        transform: translateY(0);
        opacity: 1;
    }
    .pd-footer { border-radius: 0 0 20px 20px; }
    .pd-hero { height: 280px; }
}
