/* =============================================
   MODAL PREMIUM - FULLY RESPONSIVE
   ============================================= */

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 18, 0.98);
    backdrop-filter: blur(12px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

/* Modal Content */
.modal-content {
    background: #152522;
    width: 100%;
    max-width: 1300px;
    max-height: 90vh;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(199, 167, 108, 0.25);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* Header - sticky */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: #152522;
    border-bottom: 1px solid rgba(199, 167, 108, 0.15);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 20;
}

.modal-header-title {
    font-size: 1rem;
    font-weight: 500;
    color: #c7a76c;
    letter-spacing: 1px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(199, 167, 108, 0.1);
    border: 1px solid rgba(199, 167, 108, 0.3);
    color: #c7a76c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #c7a76c;
    color: #0f1a17;
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Left Column - Image Section */
.modal-left {
    background: #0f1a17;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Main Image Container */
.image-main-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 280px;
    background: #0f1a17;
}

.image-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    overflow: hidden;
    min-height: 240px;
}

.image-wrapper:active {
    cursor: grabbing;
}

.modal-main-image {
    max-width: 100%;
    max-height: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.1s ease;
    transform-origin: center center;
}

/* Zoom Hint & Controls */
.zoom-hint {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(10, 20, 18, 0.8);
    color: #c7a76c;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.65rem;
    border: 1px solid rgba(199, 167, 108, 0.3);
    z-index: 5;
    backdrop-filter: blur(4px);
}

.zoom-controls {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 5;
    background: rgba(10, 20, 18, 0.7);
    padding: 0.3rem;
    border-radius: 2rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(199, 167, 108, 0.3);
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(199, 167, 108, 0.5);
    color: #c7a76c;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: #c7a76c;
    color: #0f1a17;
    transform: scale(1.05);
}

/* Gallery Thumbnails */
.gallery-thumbnails {
    height: 80px;
    padding: 0.75rem;
    border-top: 1px solid rgba(199, 167, 108, 0.15);
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: #1a2a25;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #c7a76c;
    border-radius: 2px;
}

.thumbnail-item {
    flex: 0 0 65px;
    height: 65px;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.thumbnail-item:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.thumbnail-item.active {
    border-color: #c7a76c;
    opacity: 1;
}

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

/* Right Column - Product Details */
.modal-right {
    background: #152522;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Product Info Header */
.product-info-header {
    padding: 1rem 1.25rem 0.5rem;
    border-bottom: 1px solid rgba(199, 167, 108, 0.1);
    flex-shrink: 0;
}

.modal-subtitle {
    color: #c7a76c;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.25rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f5f3ef;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.modal-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #c7a76c;
}

/* Tabs */
.compact-tabs {
    display: flex;
    padding: 0.5rem 1.25rem;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(199, 167, 108, 0.1);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.compact-tab {
    padding: 0.5rem 0;
    background: transparent;
    border: none;
    color: #b8c1bd;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.compact-tab i {
    font-size: 0.9rem;
}

.compact-tab:hover {
    color: #c7a76c;
}

.compact-tab.active {
    color: #c7a76c;
    border-bottom-color: #c7a76c;
}

.tab-count {
    background: rgba(199, 167, 108, 0.15);
    color: #c7a76c;
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 1rem;
    margin-left: 0.2rem;
}

/* Tab Content Container */
.tab-content-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    min-height: 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Details Tab */
.details-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-description {
    color: #b8c1bd;
    line-height: 1.6;
    font-size: 0.875rem;
}

/* Action Buttons */
.action-buttons {
    margin-top: 0.5rem;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #c7a76c, #b5945a);
    color: #0f1a17;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(199, 167, 108, 0.3);
}

.modal-footer-note {
    color: #b8c1bd;
    font-size: 0.7rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    opacity: 0.7;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    border-color: #c7a76c;
    transform: scale(1.02);
}

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

/* Videos Grid */
.videos-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.video-item {
    background: #1a2a25;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgba(199, 167, 108, 0.2);
    transition: all 0.3s ease;
}

.video-item:hover {
    border-color: #c7a76c;
    transform: translateY(-2px);
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    cursor: pointer;
}

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

.video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(199, 167, 108, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f1a17;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.video-info {
    padding: 0.75rem;
}

.video-title {
    color: #f5f3ef;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.video-platform {
    color: #c7a76c;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: 2rem;
    color: #b8c1bd;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(199, 167, 108, 0.2);
    border-top-color: #c7a76c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.75rem;
}

.loading-spinner-small {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(199, 167, 108, 0.2);
    border-top-color: #c7a76c;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #b8c1bd;
}

.empty-state i {
    font-size: 2.5rem;
    color: rgba(199, 167, 108, 0.2);
    margin-bottom: 0.75rem;
}

/* Thumbnail placeholder */
.thumbnail-placeholder {
    width: 65px;
    height: 65px;
    background: #1a2a25;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================= */
/* DESKTOP STYLES (1025px and above) */
/* ============================================= */
@media (min-width: 1025px) {
    .modal-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        height: calc(90vh - 60px);
        overflow: hidden;
    }
    
    .modal-left {
        border-right: 1px solid rgba(199, 167, 108, 0.15);
        max-height: 100%;
    }
    
    .modal-right {
        overflow: hidden;
    }
    
    .image-main-container {
        min-height: 0;
        flex: 1;
        padding: 1.5rem;
    }
    
    .image-wrapper {
        height: 100%;
        min-height: 300px;
    }
    
    .modal-main-image {
        max-height: 500px;
    }
    
    .gallery-thumbnails {
        height: 100px;
        flex-shrink: 0;
    }
    
    .thumbnail-item {
        flex: 0 0 80px;
        height: 80px;
    }
    
    .product-info-header {
        padding: 1.5rem 1.5rem 0.5rem;
    }
    
    .modal-title {
        font-size: 1.8rem;
    }
    
    .modal-price {
        font-size: 1.8rem;
    }
    
    .compact-tabs {
        padding: 0.5rem 1.5rem;
    }
    
    .tab-content-container {
        padding: 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .zoom-controls {
        opacity: 0;
    }
    
    .image-main-container:hover .zoom-controls {
        opacity: 1;
    }
}

/* ============================================= */
/* TABLET STYLES (768px - 1024px) */
/* ============================================= */
@media (min-width: 768px) and (max-width: 1024px) {
    .modal-content {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .image-main-container {
        min-height: 320px;
    }
    
    .modal-main-image {
        max-height: 320px;
    }
    
    .gallery-thumbnails {
        height: 85px;
    }
    
    .thumbnail-item {
        flex: 0 0 75px;
        height: 75px;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .modal-price {
        font-size: 1.4rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* ============================================= */
/* MOBILE STYLES (up to 767px) */
/* ============================================= */
@media (max-width: 767px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-content {
        max-height: 95vh;
        border-radius: 1.25rem 1.25rem 0 0;
        border-bottom: none;
    }
    
    .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .modal-header-title {
        font-size: 0.9rem;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
    }
    
    .image-main-container {
        min-height: 240px;
        padding: 0.75rem;
    }
    
    .image-wrapper {
        min-height: 200px;
    }
    
    .modal-main-image {
        max-height: 220px;
    }
    
    .zoom-hint {
        font-size: 0.6rem;
        padding: 0.2rem 0.6rem;
    }
    
    .zoom-controls {
        gap: 0.3rem;
    }
    
    .zoom-btn {
        width: 28px;
        height: 28px;
    }
    
    .gallery-thumbnails {
        height: 70px;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .thumbnail-item {
        flex: 0 0 55px;
        height: 55px;
    }
    
    .product-info-header {
        padding: 0.75rem 1rem 0.5rem;
    }
    
    .modal-subtitle {
        font-size: 0.65rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-price {
        font-size: 1.1rem;
    }
    
    .compact-tabs {
        padding: 0.4rem 1rem;
        gap: 0.75rem;
    }
    
    .compact-tab {
        font-size: 0.8rem;
    }
    
    .compact-tab i {
        font-size: 0.8rem;
    }
    
    .tab-content-container {
        padding: 0.75rem 1rem;
    }
    
    .modal-description {
        font-size: 0.8rem;
        line-height: 1.5;
    }
    
    .btn-whatsapp {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .modal-footer-note {
        font-size: 0.65rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 0.5rem;
    }
    
    .empty-state {
        padding: 1.5rem;
    }
    
    .empty-state i {
        font-size: 2rem;
    }
    
    .loading-spinner {
        width: 28px;
        height: 28px;
    }
}