/* =====================================================
   PRODUCT DETAIL MODAL
   ===================================================== */

/* Modal Overlay */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

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

.product-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: overlayFadeIn 0.3s ease-out;
}

/* Modal Container */
.product-modal-container {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
}

/* Close Button */
.product-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    color: var(--color-text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.product-modal-close:hover {
    background: var(--color-white);
    color: var(--color-error);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Favorite Button */
.product-modal-favorite {
    position: absolute;
    top: 16px;
    right: 68px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    color: #94A3B8;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.product-modal-favorite:hover {
    background: var(--color-white);
    color: #00BCD4;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.product-modal-favorite.is-favorite {
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.product-modal-favorite.is-favorite:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

.product-modal-favorite.pulse {
    animation: favoritePulse 0.4s ease;
}

@keyframes favoritePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Modal Content Layout */
.product-modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-height: 90vh;
    overflow: hidden;
    align-items: stretch;
}

/* Left Section - Product Image */
.product-modal-image-section {
    background: #F3F4F6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 32px 24px;
    min-height: 100%;
    height: 100%;
}

/* Image Wrapper - Centers image vertically */
.product-modal-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.product-modal-image-container {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s;
}

.product-modal-image-container:hover {
    transform: scale(1.02);
}

.product-modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

/* Right Section - Product Details */
.product-modal-details-section {
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 90vh;
}

/* Product Header */
.product-modal-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-border);
}

.product-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    margin: 0;
}

.product-modal-description {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Variations Section */
.product-modal-variations {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.variation-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 7px;
}

.variation-label i {
    color: var(--color-primary);
    font-size: 14px;
}

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

/* Color Options */
.color-option {
    min-width: 90px;
    padding: 10px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.color-option:hover {
    border-color: var(--color-primary-light);
    background: #F0F4FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 89, 152, 0.1);
}

.color-option.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, #F0F4FF 0%, #E8EDFF 100%);
    color: var(--color-primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 89, 152, 0.2);
}

.color-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Size Options */
.size-option {
    min-width: 60px;
    padding: 10px 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.size-option:hover {
    border-color: var(--color-primary-light);
    background: #F0F4FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 89, 152, 0.1);
}

.size-option.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, #F0F4FF 0%, #E8EDFF 100%);
    color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(59, 89, 152, 0.2);
}

.size-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Variation Stock Info */
.variation-stock-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    border: 1px solid #86EFAC;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: #16A34A;
}

.variation-stock-info i {
    font-size: 14px;
}

.variation-stock-info.low-stock {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-color: #FCD34D;
    color: #D97706;
}

.variation-stock-info.out-of-stock {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-color: #FCA5A5;
    color: #DC2626;
}

/* Quantity Selector */
.product-modal-quantity {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quantity-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 7px;
}

.quantity-label i {
    color: var(--color-primary);
    font-size: 14px;
}

.quantity-selector {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-white);
    width: fit-content;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--color-white);
    color: var(--color-primary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #F0F4FF;
    color: var(--color-primary-dark);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 55px;
    height: 40px;
    border: none;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-white);
}

.quantity-input:focus {
    outline: none;
}

/* Price & Add to Cart Footer */
.product-modal-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 2px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-modal-price-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price-old-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-old {
    font-size: 15px;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.price-discount-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #FDF2F8 0%, #FCE7F3 100%);
    border: 1px solid #FBCFE8;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-accent);
}

.price-discount-badge i {
    font-size: 11px;
}

.price-current {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #D4A574 0%, #E5B88A 50%, #F0C89A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Add to Cart Button */
.product-modal-add-btn {
    width: 100%;
    padding: 16px 28px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #00ACC1 0%, #26C6DA 50%, #4DD0E1 100%);
    color: var(--color-white);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.35);
}

.product-modal-add-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #0097A7 0%, #00ACC1 50%, #26C6DA 100%);
    box-shadow: 0 8px 20px rgba(0, 188, 212, 0.5);
}

.product-modal-add-btn:active {
    transform: translateY(0);
}

.product-modal-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.product-modal-add-btn i {
    font-size: 18px;
}

/* Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .product-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .product-modal-content {
        grid-template-columns: 1fr;
    }
    
    .product-modal-image-section {
        min-height: 300px;
        padding: 32px 24px;
    }
    
    .product-modal-details-section {
        padding: 32px 24px;
    }
    
    .product-modal-title {
        font-size: 22px;
    }
    
    .price-current {
        font-size: 28px;
    }
}

/* Scrollbar Styling for Modal Content */
.product-modal-content::-webkit-scrollbar,
.product-modal-details-section::-webkit-scrollbar {
    width: 8px;
}

.product-modal-content::-webkit-scrollbar-track,
.product-modal-details-section::-webkit-scrollbar-track {
    background: #F3F4F6;
}

.product-modal-content::-webkit-scrollbar-thumb,
.product-modal-details-section::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.product-modal-content::-webkit-scrollbar-thumb:hover,
.product-modal-details-section::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Trust Badges - Modal */
.modal-trust-badges {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    justify-content: center;
    padding-top: 24px;
    margin-top: auto;
}

.modal-trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--color-white);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.modal-trust-badge:hover {
    border-color: #D1D5DB;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.modal-trust-badge i {
    font-size: 14px;
    color: #6B7280;
}

@media (max-width: 768px) {
    .modal-trust-badges {
        gap: 8px;
        padding-top: 16px;
        max-width: 100%;
    }
    
    .modal-trust-badge {
        padding: 8px 12px;
        font-size: 11px;
        gap: 6px;
    }
    
    .modal-trust-badge i {
        font-size: 12px;
    }
}

