/* =====================================================================
   PRODUTO — detalhe do item (estilo delivery/fast-food)
   ===================================================================== */

.product-detail-page {
    width: 100%;
    max-width: var(--frame);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
    background: var(--surface);
    color: var(--ink);
}

.product-detail-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 10px;
    padding: max(16px, env(safe-area-inset-top)) 16px 14px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
}

.product-detail-back {
    display: grid; place-items: center;
    width: 40px; height: 40px; border: 0; border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .16); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.product-detail-back:hover { background: rgba(255, 255, 255, .3); }
.product-detail-header-space { width: 40px; height: 40px; }

.product-detail-title { text-align: center; }
.product-detail-title h1 { font-size: 1.02rem; font-weight: 800; }
.product-detail-title p { margin-top: 2px; font-size: .68rem; opacity: .88; }

.product-detail-content { padding: 16px; }

.product-detail-image {
    width: 100%; height: 280px; overflow: hidden;
    border-radius: var(--r-lg); background: #eee; box-shadow: var(--shadow-sm);
}
.product-detail-image img { width: 100%; height: 100%; object-fit: cover; }

.product-detail-info { padding: 20px 4px 0; }
.product-detail-info h2 { font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.product-detail-info p { margin-top: 10px; color: var(--muted); font-size: .92rem; line-height: 1.6; }

.product-detail-purchase {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 24px; padding: 16px; border-radius: var(--r-md);
    background: var(--surface-2); border: 1px solid var(--line);
}
.product-detail-purchase > strong { color: var(--brand); font-size: 1.6rem; font-weight: 800; }

.product-detail-quantity {
    display: flex; align-items: center; gap: 6px;
    padding: 6px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line);
}
.product-detail-quantity button {
    display: grid; place-items: center;
    width: 38px; height: 38px; border: 0; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand); font-size: 1.4rem; line-height: 1; cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.product-detail-quantity button:hover { background: var(--brand); color: #fff; }
.product-detail-quantity span { min-width: 26px; text-align: center; font-size: 1.1rem; font-weight: 800; color: var(--ink); }

.product-detail-footer {
    position: fixed; z-index: 30; left: 50%; bottom: 0;
    width: min(100%, var(--frame)); transform: translateX(-50%);
    padding: 12px 16px max(14px, env(safe-area-inset-bottom));
    background: var(--surface); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
}
.product-detail-add {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; min-height: 56px; padding: 0 22px; border: 0; border-radius: var(--r-md);
    background: var(--brand); color: #fff; font-size: 1rem; font-weight: 800; cursor: pointer;
    box-shadow: 0 8px 20px rgba(134, 31, 43, .22);
    transition: background .12s ease, transform .12s ease;
}
.product-detail-add:hover { background: var(--brand-dark); }
.product-detail-add:active { transform: scale(.99); }
.product-detail-add span { font-size: 1.05rem; }

.product-detail-state {
    display: grid; min-height: 100dvh; place-content: center; gap: 18px; padding: 24px; text-align: center;
    max-width: var(--frame); margin: 0 auto;
}
.product-detail-secondary {
    min-height: 50px; padding: 0 22px; border: 0; border-radius: var(--r-md);
    background: var(--brand); color: #fff; font-weight: 700; cursor: pointer;
}

@media (min-width: 768px) {
    .product-detail-content { width: min(100%, 900px); margin: 0 auto; padding: 24px 32px; }
    .product-detail-image { height: clamp(300px, 42vw, 460px); }
    .product-detail-purchase { padding: 20px 24px; }
    .product-detail-footer { max-width: 900px; }
}

@media (max-width: 420px) {
    .product-detail-content { padding: 12px; }
    .product-detail-image { height: min(64vw, 280px); }
    .product-detail-info h2 { font-size: 1.3rem; }
    .product-detail-footer { padding-left: 12px; padding-right: 12px; }
}
