/**
 * Quick View Modal Styles
 *
 * @package Petalos_y_Raices
 */

/* Quick View Button on Product Card */
.petalos-quick-view-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.petalos-quick-view-btn svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-primary, #2C3E2E);
    transition: color 0.2s;
}

.petalos-quick-view-btn:hover {
    background: var(--color-primary, #8B9D83);
}

.petalos-quick-view-btn:hover svg {
    color: #fff;
}

.petalos-product-card:hover .petalos-quick-view-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Modal Overlay */
.petalos-quick-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Modal Container */
.petalos-quick-view-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.petalos-quick-view-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

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

.petalos-qv-close svg {
    width: 20px;
    height: 20px;
    color: #333;
}

.petalos-qv-close:hover {
    background: #f5f5f5;
    transform: rotate(90deg);
}

/* Modal Content */
.petalos-qv-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    overflow: hidden;
}

/* Loading State */
.petalos-qv-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    grid-column: 1 / -1;
}

.petalos-qv-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border, #E8E4DF);
    border-top-color: var(--color-primary, #8B9D83);
    border-radius: 50%;
    animation: qv-spin 0.8s linear infinite;
}

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

/* Gallery Section */
.petalos-qv-gallery {
    position: relative;
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
}

.petalos-qv-main-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 300px;
}

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

.petalos-qv-thumbnails {
    display: flex;
    gap: 8px;
    padding: 1rem 2rem 2rem;
    overflow-x: auto;
    justify-content: center;
}

.petalos-qv-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
    background: #fff;
}

.petalos-qv-thumb:hover,
.petalos-qv-thumb.active {
    border-color: var(--color-primary, #8B9D83);
}

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

/* Sale Badge in Modal */
.petalos-qv-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--color-secondary, #D4B5B0);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Info Section */
.petalos-qv-info {
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.petalos-qv-title {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--color-text-primary, #2C3E2E);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.petalos-qv-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary, #2C3E2E);
    margin-bottom: 1rem;
}

.petalos-qv-price del {
    color: #999;
    font-weight: 400;
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.petalos-qv-price ins {
    text-decoration: none;
    color: var(--color-primary, #8B9D83);
}

/* Stock Status */
.petalos-qv-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.petalos-qv-stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.petalos-qv-stock.in-stock .petalos-qv-stock-dot {
    background: #22c55e;
}

.petalos-qv-stock.in-stock {
    color: #16a34a;
}

.petalos-qv-stock.out-of-stock .petalos-qv-stock-dot {
    background: #ef4444;
}

.petalos-qv-stock.out-of-stock {
    color: #dc2626;
}

/* Short Description */
.petalos-qv-description {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text-secondary, #6B7B6A);
    margin-bottom: 1.5rem;
    flex: 1;
}

.petalos-qv-description p {
    margin: 0 0 0.75rem 0;
}

.petalos-qv-description p:last-child {
    margin-bottom: 0;
}

/* Add to Cart Section */
.petalos-qv-add-to-cart {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border, #E8E4DF);
}

.petalos-qv-quantity-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.petalos-qv-quantity-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary, #6B7B6A);
}

.petalos-qv-quantity {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border, #E8E4DF);
    border-radius: 8px;
    overflow: hidden;
}

.petalos-qv-qty-btn {
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--color-text-secondary, #6B7B6A);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.petalos-qv-qty-btn:hover {
    background: var(--color-background-soft, #F5F1ED);
    color: var(--color-text-primary, #2C3E2E);
}

.petalos-qv-qty-input {
    width: 60px;
    height: 40px;
    border: none;
    border-left: 1px solid var(--color-border, #E8E4DF);
    border-right: 1px solid var(--color-border, #E8E4DF);
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    -moz-appearance: textfield;
}

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

/* Buttons */
.petalos-qv-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.petalos-qv-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: #2d3a2e;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.petalos-qv-add-btn:hover {
    background: var(--color-primary, #8B9D83);
}

.petalos-qv-add-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

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

.petalos-qv-add-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.petalos-qv-add-btn.added {
    background: var(--color-primary, #8B9D83);
}

.petalos-qv-view-full {
    display: block;
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-secondary, #6B7B6A);
    text-decoration: none;
    padding: 0.5rem;
    transition: color 0.2s;
}

.petalos-qv-view-full:hover {
    color: var(--color-primary, #8B9D83);
}

/* Variable Products */
.petalos-qv-variations {
    margin-bottom: 1rem;
}

.petalos-qv-variation-row {
    margin-bottom: 1rem;
}

.petalos-qv-variation-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary, #6B7B6A);
    margin-bottom: 0.5rem;
}

.petalos-qv-variation-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border, #E8E4DF);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--color-text-primary, #2C3E2E);
    background: #fff;
    cursor: pointer;
}

.petalos-qv-variation-select:focus {
    outline: none;
    border-color: var(--color-primary, #8B9D83);
}

/* Categories/Meta */
.petalos-qv-meta {
    font-size: 0.8125rem;
    color: var(--color-text-light, #9CA89B);
    margin-top: 1rem;
}

.petalos-qv-meta a {
    color: inherit;
    text-decoration: none;
}

.petalos-qv-meta a:hover {
    color: var(--color-primary, #8B9D83);
}

/* Responsive */
@media (max-width: 768px) {
    .petalos-quick-view-modal {
        width: 95%;
        max-height: 95vh;
    }

    .petalos-qv-content {
        grid-template-columns: 1fr;
    }

    .petalos-qv-gallery {
        max-height: 300px;
    }

    .petalos-qv-main-image {
        padding: 1rem;
        min-height: 200px;
    }

    .petalos-qv-main-image img {
        max-height: 200px;
    }

    .petalos-qv-thumbnails {
        padding: 0.75rem 1rem;
    }

    .petalos-qv-thumb {
        width: 50px;
        height: 50px;
    }

    .petalos-qv-info {
        padding: 1.5rem;
    }

    .petalos-qv-title {
        font-size: 1.5rem;
    }

    .petalos-qv-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .petalos-quick-view-overlay,
    .petalos-quick-view-modal,
    .petalos-quick-view-btn {
        transition: opacity 0.2s;
    }

    .petalos-quick-view-modal.active {
        transform: translate(-50%, -50%);
    }

    .petalos-qv-close:hover {
        transform: none;
    }
}
