/* ===== MODAL STYLES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6B7280;
    transition: color 0.2s;
    z-index: 1001;
}

.modal-close:hover {
    color: #0b3c5d;
}

.product-images-carousel {
    display: grid;
    grid-template-columns: 1fr 4fr;
    gap: 16px;
    margin-bottom: 24px;
}

.product-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid #E5E7EB;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
}

.product-thumbnail:hover {
    border-color: #0b3c5d;
}

.product-thumbnail.active {
    border-color: #0b3c5d;
    box-shadow: 0 0 0 3px rgba(11, 60, 93, 0.1);
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-main-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F3F4F6;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.product-main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: imageSlideIn 0.5s ease-out;
}

@keyframes imageSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-main-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
}

/* ===== IMAGE SLIDER CONTROLS ===== */
.slider-wrapper {
    position: relative;
    width: 100%;
}

.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background-color: #F3F4F6;
}

.slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
    background-color: #F3F4F6;
}

.slider-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 20px;
}

.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(11, 60, 93, 0.9);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.slider-nav-btn:hover {
    background: rgba(11, 60, 93, 1);
    transform: translateY(-50%) scale(1.1);
}

.slider-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.slider-nav-btn.prev {
    left: 16px;
}

.slider-nav-btn.next {
    right: 16px;
}

.slider-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.slider-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #D1D5DB;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.slider-indicator.active {
    background-color: #0b3c5d;
    width: 24px;
    border-radius: 4px;
    transform: scale(1.2);
}

.slider-indicator:hover {
    background-color: #6B7280;
}

.image-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(11, 60, 93, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
    }

    .product-images-carousel {
        grid-template-columns: 1fr;
    }

    .product-thumbnails {
        display: flex;
        flex-direction: row;
        max-height: auto;
        overflow-x: auto;
    }

    .product-thumbnail {
        flex-shrink: 0;
    }

    .slider-slide {
        height: 350px;
    }

    .slider-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .slider-nav-btn.prev {
        left: 8px;
    }

    .slider-nav-btn.next {
        right: 8px;
    }

    .image-counter {
        bottom: 8px;
        right: 8px;
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* ===== LOADER ===== */
.spinner {
    border: 3px solid #E5E7EB;
    border-top: 3px solid #0b3c5d;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== CURSOR POINTER FOR PRODUCTS ===== */
.product-card-clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.product-card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(11, 60, 93, 0.15);
}

/* ===== PRODUCT DETAILS TOOLTIP / PREVIEW ===== */
.product-preview-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    border: 2px solid #0b3c5d;
    border-radius: 12px;
    padding: 12px 16px;
    width: 250px;
    box-shadow: 0 10px 30px rgba(11, 60, 93, 0.2);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-clickable:hover .product-preview-tooltip {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(-15px);
}

.product-preview-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #0b3c5d;
}

.preview-title {
    font-weight: 700;
    color: #0b3c5d;
    font-size: 13px;
    margin-bottom: 6px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-detail {
    font-size: 12px;
    color: #6B7280;
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    white-space: nowrap;
    overflow: hidden;
}

.preview-detail-label {
    font-weight: 600;
    color: #374151;
    margin-right: 6px;
}
