.essentials-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.essentials-modal[hidden] {
    display: none !important;
}

.essentials-modal--stacked {
    z-index: 1300;
}

.essentials-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
}

.essentials-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
}

.essentials-modal-dialog--picker {
    width: min(480px, 100%);
}

.essentials-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: 0;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
}

.essentials-product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.essentials-product-image-wrap {
    background: #f8f8f8;
    border-radius: 10px;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.essentials-product-image {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
}

.essentials-product-body h2 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    line-height: 1.3;
    padding-right: 2rem;
}

.essentials-product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #c45c5c;
    margin: 0 0 1rem;
}

.essentials-product-price:empty {
    display: none;
}

.essentials-product-description {
    color: #444;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-height: 240px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.essentials-product-description:empty {
    display: none;
}

.essentials-wishlist-picker {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
    max-height: 280px;
    overflow-y: auto;
}

.essentials-wishlist-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    background: #fafafa;
}

.essentials-wishlist-option:hover {
    border-color: #c45c5c;
}

.essentials-wishlist-option.is-selected {
    border-color: #c45c5c;
    background: #fff5f3;
}

.essentials-wishlist-option input {
    margin: 0;
}

.essentials-wishlist-option-meta {
    color: #666;
    font-size: 0.875rem;
}

.essentials-wishlist-message {
    margin: 0.5rem 0 0;
    color: #666;
    line-height: 1.5;
}

.essentials-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.essentials-view-btn {
    width: 100%;
}

/* Essentials carousel */
.recommended-products-carousel-wrap {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommended-products-carousel {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    flex: 1;
    min-width: 0;
    padding: 0.25rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.recommended-products-carousel::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.carousel-nav {
    flex-shrink: 0;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    line-height: 1;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.carousel-nav:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.recommended-card {
    flex: 0 0 200px;
    width: 200px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    padding: 0.75rem;
    box-sizing: border-box;
}

.rec-image-wrap {
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
    background: #fff;
}

.rec-image {
    width: 100%;
    height: 80px;
    object-fit: contain;
    display: block;
}

.rec-image-fallback {
    width: 100%;
    height: 80px;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rec-title {
    height: 40px;
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.rec-price {
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: #059669;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
}

.rec-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.rec-card-actions .btn {
    width: 100%;
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.essentials-modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .essentials-product-layout {
        grid-template-columns: 1fr;
    }

    .essentials-product-image-wrap {
        min-height: 200px;
    }
}
