/**
 * Product Quick View Modal Styles
 * Milano-inspired design
 */

/* Modal Overlay */
.quickview-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.quickview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Modal Container */
.quickview-container {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: quickviewSlideIn 0.3s ease-out;
}

@keyframes quickviewSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.quickview-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quickview-close:hover {
    background: #f5f5f5;
    transform: scale(1.05);
}

/* Content Grid */
.quickview-content {
    display: grid;
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .quickview-content {
        grid-template-columns: 1fr 1fr;
        overflow: hidden;
    }
}

/* Media Section */
.quickview-media {
    background: #f8f8f8;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quickview-image-slider {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.quickview-main-image {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.quickview-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Thumbnails */
.quickview-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.quickview-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    background: #fff;
}

.quickview-thumb:hover,
.quickview-thumb.active {
    border-color: var(--color-primary, #1a1a1a);
}

.quickview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Slider Navigation */
.quickview-slider-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 0.5rem;
    pointer-events: none;
}

.quickview-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quickview-nav-btn:hover {
    background: #f5f5f5;
    transform: scale(1.05);
}

.quickview-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Info Section */
.quickview-info {
    padding: 2rem;
    overflow-y: auto;
    max-height: 90vh;
}

@media (min-width: 768px) {
    .quickview-info {
        padding: 2.5rem;
    }
}

.quickview-info-inner {
    max-width: 400px;
}

/* Category */
.quickview-category {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 0.5rem;
}

/* Title */
.quickview-title {
    font-size: 1.625rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    line-height: 1.3;
    color: var(--color-heading, #1a1a1a);
}

/* Rating */
.quickview-rating {
    margin-bottom: 0.75rem;
}

.quickview-stars {
    display: flex;
    gap: 2px;
}

.quickview-stars .star {
    color: #d4d4d4;
    font-size: 1rem;
}

.quickview-stars .star.filled {
    color: #fbbf24;
}

/* Price */
.quickview-price {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.quickview-price .price-current {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-heading, #1a1a1a);
}

.quickview-price .price-original {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

/* Description */
.quickview-description {
    color: #666;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-height: 100px;
    overflow-y: auto;
}

/* Actions */
.quickview-actions {
    margin-bottom: 1.5rem;
}

.quickview-actions-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* Quantity */
.quickview-quantity {
    display: flex;
    align-items: center;
    background: #f8f8f8;
    border-radius: 23px;
    padding: 0 7px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.qty-btn:hover {
    opacity: 0.7;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-input {
    width: 60px;
    padding: 0;
    text-align: center;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 500;
    -moz-appearance: textfield;
    outline: none;
}

.qty-input:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Unit Label */
.quickview-unit {
    font-size: 1.1rem;
    color: var(--color-text, #666);
    margin-left: 0.5rem;
    white-space: nowrap;
    background: #e9e9e9;
    border-left: 1px solid #CCC;
    padding: 3px 8px;
    border-radius: 0 20px 20px 0;
}

/* Add to Cart Button */
.quickview-add-cart {
    flex: 1;
    min-width: 150px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    border-radius: 30px;
}

.quickview-add-cart .btn-loading {
    display: none;
}

.quickview-add-cart.loading .btn-text {
    display: none;
}

.quickview-add-cart.loading .btn-loading {
    display: block;
}

/* Wishlist Button */
.quickview-wishlist {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quickview-wishlist:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.quickview-wishlist.active {
    background: #fee2e2;
    border-color: #ef4444;
}

.quickview-wishlist.active svg {
    fill: #ef4444;
    stroke: #ef4444;
}

/* View Details Link */
.quickview-view-details {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-heading, #1a1a1a);
    font-weight: 500;
    text-decoration: none;
    transition: gap 0.2s ease;
}

.quickview-view-details:hover {
    gap: 0.75rem;
}

/* Spin animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .quickview-container {
        max-height: 95vh;
    }

    .quickview-content {
        max-height: 95vh;
    }

    .quickview-media {
        padding: 1.5rem;
    }

    .quickview-info {
        padding: 1.5rem;
    }

    .quickview-title {
        font-size: 1.375rem;
    }

    .quickview-actions-row {
        flex-wrap: wrap;
    }

    .quickview-add-cart {
        flex: 1;
        min-width: 120px;
    }

    .quickview-slider-nav {
        display: none;
    }
}

/* Loading State */
.quickview-modal.loading .quickview-container {
    opacity: 0;
    transform: scale(0.95);
}

.quickview-modal.loading .quickview-loader {
    display: flex;
}

.quickview-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.quickview-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.quickview-loader-text {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Body scroll lock */
body.quickview-open {
    overflow: hidden;
}
