/* ===== ITEM DETAIL POPUP COMMON STYLES ===== */

/* Overlay */
.item-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.item-detail-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.item-detail-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 301;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}

.item-detail-popup.active {
    transform: translateY(0);
}

/* Header */
.item-detail-header {
    position: relative;
}

/* Image Carousel */
.item-image-carousel {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.item-image-track {
    display: flex;
    height: 100%;
    transition: transform 0.4s ease;
}

.item-image-slide {
    min-width: 100%;
    height: 100%;
}

.item-image-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-image-dots {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.item-image-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.item-image-dot.active {
    width: 24px;
    background: white;
    border-radius: 4px;
}

.item-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 5;
}

.item-image-carousel:hover .item-image-nav {
    opacity: 1;
}

.item-image-nav.prev { left: 10px; }
.item-image-nav.next { right: 10px; }

/* Close Button */
.item-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 10;
}

.item-detail-close:hover {
    background: #fff;
    transform: scale(1.05);
}

/* Item Badge (Veg/Non-veg) */
.item-detail-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid;
    background: white;
    z-index: 5;
}

.item-detail-badge.veg {
    border-color: #22c55e;
}

.item-detail-badge.veg::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
}

.item-detail-badge.non-veg {
    border-color: #ef4444;
}

.item-detail-badge.non-veg::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid #ef4444;
}

/* Content */
.item-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.item-detail-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.item-detail-desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 0 0 16px;
}

.item-detail-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.item-detail-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10847e;
}

.item-detail-mrp {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

.item-detail-discount {
    background: #dcfce7;
    color: #16a34a;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.item-detail-discount:empty {
    display: none;
}

/* Variations Section */
.variations-section {
    margin-bottom: 20px;
}

.variations-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.variations-title i {
    color: #10847e;
}

.variation-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.variation-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variation-option:hover {
    border-color: #10847e;
    background: #f0faf9;
}

.variation-option.active {
    border-color: #10847e;
    background: #e8f5f4;
}

.variation-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.variation-radio {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.variation-option.active .variation-radio {
    border-color: #10847e;
}

.variation-radio::after {
    content: '';
    width: 12px;
    height: 12px;
    background: #10847e;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.variation-option.active .variation-radio::after {
    opacity: 1;
    transform: scale(1);
}

.variation-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1a1a1a;
}

.variation-price {
    font-size: 1rem;
    font-weight: 600;
    color: #10847e;
}

.variation-mrp {
    color: #999;
    font-weight: 400;
    font-size: 0.85rem;
    margin-right: 4px;
}

/* Footer */
.item-detail-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.qty-selector {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
}

.qty-btn-popup {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #10847e;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.qty-btn-popup:hover {
    background: #e8f5f4;
}

.qty-btn-popup:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.qty-value {
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    color: #1a1a1a;
}

.add-to-cart-btn {
    flex: 1;
    background: #10847e;
    border: none;
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(16, 132, 126, 0.3);
}

.add-to-cart-btn:hover {
    background: #0d6b66;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 132, 126, 0.4);
}

.add-to-cart-btn.added {
    background: #22c55e;
}

/* Loader */
.item-detail-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 310;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.item-detail-loader.active {
    opacity: 1;
    visibility: visible;
}

.item-detail-loader-spinner {
    display: flex;
    gap: 6px;
}

.item-detail-loader-spinner div {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: itemDetailBounce 0.6s infinite alternate;
}

.item-detail-loader-spinner div:nth-child(2) {
    animation-delay: 0.2s;
}

.item-detail-loader-spinner div:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes itemDetailBounce {
    from { transform: translateY(0); opacity: 0.4; }
    to { transform: translateY(-10px); opacity: 1; }
}

/* Responsive */
@media (max-width: 480px) {
    .item-image-carousel {
        height: 180px;
    }

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

    .item-detail-name {
        font-size: 1.2rem;
    }

    .item-detail-price {
        font-size: 1.3rem;
    }

    .item-detail-footer {
        padding: 12px 16px;
    }

    .qty-btn-popup {
        width: 40px;
        height: 40px;
    }

    .add-to-cart-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}
