body.modal-open {
    overflow: hidden;
}

.detail-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s 0.38s;
}

.detail-modal.active {
    pointer-events: auto;
    visibility: visible;
    transition: visibility 0s;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    opacity: 0;
    transition: opacity 0.32s ease;
    backdrop-filter: blur(10px);
}

.detail-modal.active .detail-backdrop {
    opacity: 1;
}

.detail-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 92vh;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,1) 100%);
    border-radius: 30px 30px 0 0;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow:
        0 -12px 40px rgba(15, 23, 42, 0.10),
        0 -2px 12px rgba(15, 23, 42, 0.06);
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
}

.detail-modal.active .detail-sheet {
    transform: translateY(0);
}

.detail-sheet.dragging {
    transition: none;
}

.detail-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 10px 14px 6px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.78) 100%);
    backdrop-filter: blur(14px);
}

.detail-handle {
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #d1d5db 0%, #9ca3af 100%);
    transition: all 0.22s ease;
    position: relative;
    cursor: grab;
}

.detail-handle::before {
    content: "";
    position: absolute;
    top: -12px;
    bottom: -12px;
    left: -20px;
    right: -20px;
}

.detail-handle:active {
    cursor: grabbing;
    transform: scaleX(1.15);
    background: linear-gradient(90deg, #9ca3af 0%, #6b7280 100%);
}

.detail-close-btn {
    position: absolute;
    right: 14px;
    top: 10px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 999px;
    background: rgba(255,255,255,0.82);
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 6px 16px rgba(15, 23, 42, 0.10),
        inset 0 1px 0 rgba(255,255,255,0.55);
    backdrop-filter: blur(12px);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}

.detail-close-btn:active {
    transform: scale(0.94);
}

.detail-image-wrap {
    position: relative;
    width: 100%;
    height: 270px;
    background: linear-gradient(180deg, #f4f8f4 0%, #eef7ef 100%);
    overflow: hidden;
}

.detail-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-image-fade {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 96px;
    background: linear-gradient(to top, rgba(255,255,255,0.93), rgba(255,255,255,0));
}

.detail-image-wrap .organic-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    font-size: 11px;
    padding: 6px 10px;
}

.detail-image-wrap .organic-badge.hidden {
    display: none;
}

.detail-content {
    position: relative;
    margin-top: -14px;
    padding: 0 20px 12px;
    z-index: 2;
}

.detail-cat-tag {
    display: inline-flex;
    align-items: center;
    background: #eef8ef;
    color: var(--brand-green-dark);
    border: 1px solid rgba(46, 139, 61, 0.08);
    font-size: 11px;
    font-weight: 800;
    padding: 6px 11px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.detail-name {
    font-size: 23px;
    font-weight: 800;
    line-height: 1.22;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.detail-price-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, #fbfdfb 0%, #f6faf7 100%);
    border: 1px solid rgba(46, 139, 61, 0.08);
    box-shadow:
        0 8px 22px rgba(46, 139, 61, 0.05),
        inset 0 1px 0 rgba(255,255,255,0.85);
    margin-bottom: 18px;
}

.detail-price-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-price {
    font-size: 23px;
    font-weight: 900;
    color: var(--brand-green-dark);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.detail-unit {
    font-size: 12px;
    color: var(--text-muted);
}

.detail-qty-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.detail-qty-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 999px;
    border: none;
    background: #f3f5f4;
    color: #111827;
    font-size: 20px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.detail-qty-btn:active {
    transform: scale(0.94);
    background: #eaf0eb;
}

.detail-qty {
    min-width: 26px;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.detail-description-block {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 18px;
    background: #fcfcfc;
    border: 1px solid rgba(15, 23, 42, 0.04);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.detail-description-block.hidden {
    display: none;
}

.detail-section-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-description {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.detail-cta {
    width: 100%;
    border: none;
    border-radius: 20px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #35a854 0%, #1f7a33 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    box-shadow:
        0 12px 28px rgba(31, 122, 51, 0.26),
        inset 0 1px 0 rgba(255,255,255,0.16);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.detail-cta:active {
    transform: translateY(1px) scale(0.985);
    box-shadow:
        0 8px 18px rgba(31, 122, 51, 0.20),
        inset 0 1px 0 rgba(255,255,255,0.12);
}

.detail-cta-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-cta-sep {
    opacity: 0.68;
}

@media (max-width: 420px) {
    .detail-image-wrap {
        height: 250px;
    }

    .detail-name {
        font-size: 22px;
    }

    .detail-price {
        font-size: 22px;
    }
}