/**
 * Morrey Design WooElements - Quick View Modal Styles
 */

/* ============================================
   Modal Overlay
   ============================================ */
.mdwe-quick-view-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mdwe-quick-view-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Modal Container
   ============================================ */
.mdwe-quick-view-modal {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mdwe-quick-view-overlay.is-active .mdwe-quick-view-modal {
    transform: scale(1) translateY(0);
}

/* Close Button */
.mdwe-quick-view-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.mdwe-quick-view-close:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.mdwe-quick-view-close svg {
    width: 20px;
    height: 20px;
    color: #333333;
}

/* ============================================
   Modal Content Layout
   ============================================ */
.mdwe-quick-view-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: 90vh;
}

/* ============================================
   Gallery Section
   ============================================ */
.mdwe-qv-gallery {
    position: relative;
    background: #f8f8f8;
}

.mdwe-qv-main-image {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mdwe-qv-main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* Gallery Thumbnails */
.mdwe-qv-thumbnails {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
    overflow-x: auto;
}

.mdwe-qv-thumbnail {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.mdwe-qv-thumbnail:hover {
    transform: scale(1.05);
}

.mdwe-qv-thumbnail.active {
    border-color: var(--mdwe-accent-color, #A69B73);
}

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

/* ============================================
   Product Details Section
   ============================================ */
.mdwe-qv-details {
    padding: 30px;
    overflow-y: auto;
    max-height: 90vh;
}

.mdwe-qv-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mdwe-accent-color, #A69B73);
    margin-bottom: 8px;
}

.mdwe-qv-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.mdwe-qv-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.mdwe-qv-price del {
    color: #999999;
    font-weight: 400;
    font-size: 1.1rem;
    margin-right: 10px;
}

.mdwe-qv-price ins {
    text-decoration: none;
    color: #ef4444;
}

/* Rating */
.mdwe-qv-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

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

.mdwe-qv-star {
    width: 18px;
    height: 18px;
    color: #fbbf24;
}

.mdwe-qv-star.empty {
    color: #e5e5e5;
}

.mdwe-qv-rating-count {
    font-size: 0.875rem;
    color: #666666;
}

/* ============================================
   Quick View Attributes (THC, CBD, etc.)
   ============================================ */
.mdwe-qv-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.mdwe-qv-attributes .mdwe-attribute-box {
    display: flex;
    flex-direction: column;
    min-width: 70px;
    border: 1px solid #A69B73;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.mdwe-qv-attributes .mdwe-attribute-label {
    padding: 6px 10px 3px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    color: #ffffff;
    background: #A69B73;
}

.mdwe-qv-attributes .mdwe-attribute-value {
    padding: 5px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    color: #333333;
    background: #ffffff;
}

/* All attributes use the same color (#A69B73) */

/* Stock Status */
.mdwe-qv-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.mdwe-qv-stock.in-stock {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.mdwe-qv-stock.out-of-stock {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.mdwe-qv-stock.on-backorder {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.mdwe-qv-stock svg {
    width: 16px;
    height: 16px;
}

/* Description */
.mdwe-qv-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555555;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

/* ============================================
   Variations
   ============================================ */
.mdwe-qv-variations {
    margin-bottom: 24px;
}

.mdwe-qv-variation {
    margin-bottom: 16px;
}

.mdwe-qv-variation label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
}

.mdwe-qv-variation select {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.mdwe-qv-variation select:focus {
    outline: none;
    border-color: var(--mdwe-accent-color, #A69B73);
}

/* ============================================
   Add to Cart Section
   ============================================ */
.mdwe-qv-add-to-cart {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

/* Quantity Input */
.mdwe-qv-quantity {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.mdwe-qv-qty-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: #333333;
    transition: background-color 0.2s ease;
}

.mdwe-qv-qty-btn:hover {
    background: #e5e5e5;
}

.mdwe-qv-qty-btn:active {
    background: #d5d5d5;
}

.mdwe-qv-qty-input {
    width: 50px;
    height: 44px;
    text-align: center;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    -moz-appearance: textfield;
}

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

/* Add to Cart Button */
.mdwe-qv-add-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--mdwe-accent-color, #A69B73);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.mdwe-qv-add-btn:hover {
    background: color-mix(in srgb, var(--mdwe-accent-color, #A69B73), #000 15%);
}

.mdwe-qv-add-btn:active {
    transform: scale(0.98);
}

.mdwe-qv-add-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.mdwe-qv-add-btn svg {
    width: 20px;
    height: 20px;
}

/* Loading state */
.mdwe-qv-add-btn.is-loading {
    pointer-events: none;
}

.mdwe-qv-add-btn.is-loading .mdwe-btn-text {
    opacity: 0;
}

.mdwe-qv-add-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: mdwe-spin 0.8s linear infinite;
}

/* View Details Link */
.mdwe-qv-view-details {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--mdwe-accent-color, #A69B73);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mdwe-qv-view-details:hover {
    color: color-mix(in srgb, var(--mdwe-accent-color, #A69B73), #000 20%);
    text-decoration: underline;
}

.mdwe-qv-view-details svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 767px) {
    .mdwe-quick-view-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
        margin-top: auto;
    }
    
    .mdwe-quick-view-content {
        grid-template-columns: 1fr;
        max-height: 95vh;
    }
    
    .mdwe-qv-gallery {
        max-height: 40vh;
    }
    
    .mdwe-qv-main-image {
        height: 100%;
        aspect-ratio: auto;
    }
    
    .mdwe-qv-details {
        padding: 20px;
        max-height: 55vh;
    }
    
    .mdwe-qv-title {
        font-size: 1.25rem;
    }
    
    .mdwe-qv-price {
        font-size: 1.25rem;
    }
    
    .mdwe-qv-add-to-cart {
        flex-direction: column;
    }
    
    .mdwe-qv-quantity {
        justify-content: center;
    }
    
    .mdwe-qv-attributes {
        gap: 8px;
    }
    
    .mdwe-qv-attributes .mdwe-attribute-box {
        min-width: 60px;
        flex: 1;
        max-width: calc(50% - 4px);
    }
    
    .mdwe-qv-attributes .mdwe-attribute-label {
        padding: 6px 10px;
        font-size: 0.65rem;
    }
    
    .mdwe-qv-attributes .mdwe-attribute-value {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* ============================================
   Loading Spinner
   ============================================ */
.mdwe-qv-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.mdwe-qv-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--mdwe-accent-color, #A69B73);
    border-radius: 50%;
    animation: mdwe-spin 1s linear infinite;
}

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

