:root {
    --primary-light: #FFF0E8;
}

.no-scroll {
    overflow: hidden;
}

.add-cart-btn {
    position: relative;
}
.add-cart-btn.added {
    background: var(--success);
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.35);
}
.qty-control {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.qty-control--card {
    height: 42px;
}
.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.qty-btn:hover {
    background: rgba(255, 107, 53, 0.12);
    color: var(--primary);
}
.qty-value {
    min-width: 28px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}
.add-cart-btn .cart-qty-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.92);
    transition: transform 0.3s;
    cursor: default;
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.modal-image {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 24px 24px 0 0;
}
.modal-body {
    padding: 24px;
}
.modal-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}
.modal-weight {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 16px;
}
.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.nutrition-item {
    background: var(--bg);
    padding: 10px 6px;
    border-radius: 12px;
    text-align: center;
}
.nutrition-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}
.nutrition-label {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 2px;
}
.ingredients-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}
.ingredients-text {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 20px;
}
.composition-block {
    margin-bottom: 20px;
}
.composition-block .composition-text {
    font-size: inherit;
    color: inherit;
    line-height: 1.5;
}
.composition-block.is-collapsible:not(.is-expanded) .composition-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.composition-toggle {
    display: inline-block;
    margin-top: 8px;
    padding: 0;
    border: none;
    background: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}
.composition-toggle:hover {
    text-decoration: underline;
}
.composition-toggle[hidden] {
    display: none !important;
}
.composition-set-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.composition-set-roll {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.02);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.composition-set-roll--static {
    cursor: default;
}
.composition-set-roll-name {
    flex: 1;
    font-weight: 600;
}
.composition-set-roll-weight {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}
.composition-set-roll-toggle {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-light);
    border-bottom: 2px solid var(--text-light);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.composition-set-item.is-open .composition-set-roll-toggle {
    transform: rotate(-135deg);
    margin-top: 4px;
}
.composition-set-roll-details {
    padding: 0 12px 10px;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}
.modal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.modal-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    flex: 1;
}
.modal-add-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.modal-add-btn:hover {
    background: var(--primary-dark);
}

.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}
.bottom-sheet-overlay.active {
    display: block;
    opacity: 1;
}
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.bottom-sheet.active {
    transform: translateY(0);
}
.sheet-top {
    flex-shrink: 0;
    background: #fff;
}
.sheet-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.sheet-footer {
    display: none;
}
.sheet-handle {
    width: 40px;
    height: 4px;
    background: #DDD;
    border-radius: 2px;
    margin: 12px auto;
    cursor: grab;
    touch-action: none;
}
.sheet-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.sheet-body {
    padding: 8px 20px 24px;
}
.sheet-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    line-height: 1.15;
    color: var(--secondary);
}
.sheet-weight {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    margin: 0 0 18px;
}
.sheet-action-bar {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.06);
}
.sheet-action-price,
.sheet-price,
.sheet-price-tag {
    font-size: 26px;
    font-weight: 900;
    color: var(--secondary);
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}
.sheet-action-btn,
.sheet-add-btn {
    height: 52px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.32);
}
.sheet-action-btn:active,
.sheet-add-btn:active {
    transform: scale(0.98);
}
.sheet-action-btn:hover,
.sheet-add-btn:hover {
    background: var(--primary-dark);
}
.sheet-nutrition {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.sheet-nutrition-item {
    background: var(--bg);
    padding: 8px 4px;
    border-radius: 10px;
    text-align: center;
}
.sheet-nutrition-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
}
.sheet-nutrition-label {
    font-size: 9px;
    color: var(--text-light);
    margin-top: 2px;
}
.product-options {
    margin-bottom: 16px;
}
.product-option-group + .product-option-group {
    margin-top: 12px;
}
.product-option-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--secondary);
}
.product-option-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.product-option-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    user-select: none;
    transition: border-color 0.15s, background 0.15s;
}
.product-option-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.product-option-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
}
.product-option-choice input:checked + .product-option-check {
    border-color: var(--primary);
    background: var(--primary);
}
.product-option-choice input:checked + .product-option-check::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}
.product-option-choice:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.sheet-ingredients-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}
.sheet-ingredients-text {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 18px;
}
.sheet-ingredients-text.composition-block {
    margin-bottom: 18px;
}
.sheet-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

@media (min-width: 769px) {
    .bottom-sheet,
    .bottom-sheet-overlay {
        display: none !important;
    }
}
@media (max-width: 768px) {
    .qty-control--card {
        height: 36px;
    }
    #sheetIngredients.composition-block.is-collapsible:not(.is-expanded) .composition-text {
        -webkit-line-clamp: 3;
    }
}
