/* Explain: Styles for the product detail view, including gallery, 3D viewer. */
/* ============ Product detail sheet ============ */
.dp-detail {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 15, 8, 0.72);
    backdrop-filter: blur(4px);
}

.dp-detail[hidden] { display: none; }

.dp-detail-backdrop {
    position: absolute;
    inset: 0;
}

.dp-detail-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 40rem;
    max-height: 94vh;
    overflow-y: auto;
    background: var(--background-color);
    border-radius: 1.75rem 1.75rem 0 0;
    box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.6);
    animation: dp-sheet-in 0.3s ease;
}

@media (min-width: 1024px) {
    .dp-detail { align-items: center; padding: 2rem; }
    .dp-detail-panel { border-radius: 1.75rem; }
}

@keyframes dp-sheet-in {
    from { transform: translateY(26px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.dp-detail-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    z-index: 5;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.dp-detail-close:hover { background: rgba(0, 0, 0, 0.6); }

.dp-detail-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 2.4rem 1.5rem 1.5rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 196, 0, 0.22), transparent 60%),
        linear-gradient(160deg, #004a29, #002616);
    border-radius: 1.75rem 1.75rem 0 0;
}

.dp-detail-glow {
    position: absolute;
    width: 60%;
    aspect-ratio: 1;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(255, 196, 0, 0.45), transparent 68%);
    filter: blur(12px);
    pointer-events: none;
}

.dp-detail-img {
    position: relative;
    z-index: 1;
    width: 78%;
    max-width: 300px;
    max-height: 260px;
    object-fit: contain;
    cursor: zoom-in;
    filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.6));
    animation: dp-float 5.5s ease-in-out infinite;
}

.dp-detail-spin {
    position: absolute;
    z-index: 2;
    color: var(--secondary-color);
    font-size: 1.6rem;
}

.dp-detail-3dbtn {
    position: absolute;
    bottom: 0.9rem;
    right: 0.9rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 2px solid var(--secondary-color);
    background: rgba(0, 38, 22, 0.85);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.dp-detail-3dbtn:hover { background: rgba(0, 82, 46, 0.95); transform: translateY(-1px); }
.dp-detail-3dbtn i { color: var(--secondary-color); }

.dp-detail-thumbs {
    display: flex;
    gap: 0.6rem;
    padding: 1rem 1.25rem 0;
    overflow-x: auto;
}

.dp-thumb {
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    border-radius: 0.85rem;
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: #fff;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s ease;
}

.dp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dp-thumb.is-active { border-color: var(--secondary-color); }

.dp-detail-body { padding: 0 0 1.75rem; }

.dp-detail-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 1.25rem 1.4rem 0.4rem;
}

.dp-detail-name {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 800;
    color: var(--primary-dark);
}

.dp-detail-pricewrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dp-detail-price {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--primary-color);
}

.dp-detail-old {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 1rem;
}

.dp-detail-disc {
    background: var(--accent-color);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.18rem 0.6rem;
    border-radius: 9999px;
}

.dp-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 1.4rem 0;
}

.dp-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 1rem 1.4rem 0;
}

.dp-detail-actions .dp-btn {
    flex: 1 1 auto;
}

.dp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.8rem;
    border-radius: 9999px;
    background: var(--surface-alt);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
}

.dp-chip i { color: var(--secondary-hover); }

.dp-detail-desc {
    padding: 0.9rem 1.4rem 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.dp-detail-block {
    margin: 1.3rem 1.4rem 0;
    padding: 1.15rem 1.2rem;
    border-radius: 1.25rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.dp-detail-block .dp-block-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.02rem;
    margin-bottom: 0.9rem;
}

.dp-detail-block .dp-block-title i { color: var(--secondary-hover); }

.dp-ing-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dp-ing-list li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-color);
    font-size: 0.95rem;
}

.dp-ing-list li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 0.5rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--accent-color);
}

.dp-allergen-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

@media (min-width: 480px) {
    .dp-allergen-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.dp-allergen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.95rem 0.5rem;
    border-radius: 1rem;
    background: rgba(217, 52, 43, 0.08);
    border: 1.5px solid rgba(217, 52, 43, 0.35);
    color: #b3241d;
    text-align: center;
    box-shadow: 0 6px 16px -12px rgba(179, 36, 29, 0.6);
}

.dp-allergen i {
    font-size: 1.4rem;
}

.dp-allergen span {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
}

.dp-allergen-note,
.dp-nutrition-note {
    margin-top: 0.85rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.dp-nutrition {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

@media (min-width: 480px) {
    .dp-nutrition { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.dp-nutrition-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.8rem 0.5rem;
    border-radius: 1rem;
    background: var(--surface-alt);
    text-align: center;
}

.dp-nutrition-val {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--primary-color);
    font-size: 0.98rem;
}

.dp-nutrition-label {
    color: var(--text-muted);
    font-size: 0.74rem;
}

/* ============ 3D viewer ============ */
.dp-3d {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 12, 6, 0.9);
    backdrop-filter: blur(6px);
}

.dp-3d[hidden] { display: none; }

.dp-3d-bd {
    position: absolute;
    inset: 0;
}

.dp-3d-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 32rem);
    padding: 1rem 1rem 1.4rem;
    border-radius: 1.75rem;
    border: 3px solid var(--secondary-color);
    background:
        radial-gradient(circle at 50% 10%, rgba(255, 196, 0, 0.2), transparent 55%),
        linear-gradient(160deg, #00522b, #002616);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.95);
    text-align: center;
}

.dp-3d-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    z-index: 3;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dp-3d-close:hover { background: rgba(255, 255, 255, 0.22); }

.dp-3d-stage {
    position: relative;
    height: clamp(220px, 46vh, 320px);
    perspective: 900px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0;
    touch-action: none;
    cursor: grab;
    overflow: hidden;
}

.dp-3d-stage:active { cursor: grabbing; }

.dp-3d-plate {
    position: absolute;
    bottom: 8%;
    width: 62%;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 196, 0, 0.5), transparent 70%);
    filter: blur(4px);
}

.dp-3d-glow {
    position: absolute;
    width: 66%;
    aspect-ratio: 1;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(255, 196, 0, 0.4), transparent 68%);
    filter: blur(9px);
}

.dp-3d-img {
    position: relative;
    z-index: 1;
    width: 74%;
    max-width: 300px;
    max-height: 250px;
    object-fit: contain;
    transform-style: preserve-3d;
    filter: drop-shadow(0 22px 24px rgba(0, 0, 0, 0.65));
    will-change: transform;
}

.dp-3d-zoom {
    position: absolute;
    right: 0.9rem;
    bottom: 3.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 3;
}

.dp-3d-zbtn {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 9999px;
    border: 2px solid var(--secondary-color);
    background: rgba(0, 38, 22, 0.85);
    color: var(--secondary-color);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.dp-3d-zbtn:hover { background: rgba(255, 196, 0, 0.2); }

.dp-3d-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #cfe2cb;
    font-size: 0.8rem;
    padding: 0 0.5rem;
}

.dp-3d-hint i { color: var(--secondary-color); }