/**
 * SE-Builder Quick View Widget Styles
 */

/* ===================================
   QUICK VIEW BUTTON
   =================================== */

.se-quick-view {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 2px solid currentColor;
    background: transparent;
    color: var(--primary, #2563eb);
}

.se-quick-view:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.se-quick-view:active {
    transform: translateY(0);
}

/* Icon */
.se-qv-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.se-qv-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Button Style Variants */
.se-quick-view.se-qv-style-primary,
.se-quick-view[data-button-style="primary"] {
    background: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
    color: white;
}

.se-quick-view.se-qv-style-primary:hover,
.se-quick-view[data-button-style="primary"]:hover {
    background: var(--primary-dark, #1d4ed8);
    border-color: var(--primary-dark, #1d4ed8);
}

.se-quick-view.se-qv-style-outline,
.se-quick-view[data-button-style="outline"] {
    background: transparent;
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
}

.se-quick-view.se-qv-style-outline:hover,
.se-quick-view[data-button-style="outline"]:hover {
    background: var(--primary, #2563eb);
    color: white;
}

.se-quick-view.se-qv-style-ghost,
.se-quick-view[data-button-style="ghost"] {
    background: transparent;
    border-color: transparent;
    color: var(--primary, #2563eb);
}

.se-quick-view.se-qv-style-ghost:hover,
.se-quick-view[data-button-style="ghost"]:hover {
    background: rgba(37, 99, 235, 0.1);
}

.se-quick-view.se-qv-style-icon-only,
.se-quick-view[data-button-style="icon-only"] {
    padding: 0.5rem;
    border-radius: 50%;
}

.se-quick-view.se-qv-style-icon-only .se-qv-text,
.se-quick-view[data-button-style="icon-only"] .se-qv-text {
    display: none;
}

/* Button Size Variants */
.se-quick-view.se-qv-size-small,
.se-quick-view[data-button-size="small"] {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.se-quick-view.se-qv-size-small .se-qv-icon svg {
    width: 1rem;
    height: 1rem;
}

.se-quick-view.se-qv-size-default,
.se-quick-view[data-button-size="default"] {
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
}

.se-quick-view.se-qv-size-large,
.se-quick-view[data-button-size="large"] {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

.se-quick-view.se-qv-size-large .se-qv-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Button Shape Variants */
.se-quick-view.se-qv-shape-square,
.se-quick-view[data-button-shape="square"] {
    border-radius: 0;
}

.se-quick-view.se-qv-shape-rounded,
.se-quick-view[data-button-shape="rounded"] {
    border-radius: 0.5rem;
}

.se-quick-view.se-qv-shape-pill,
.se-quick-view[data-button-shape="pill"] {
    border-radius: 9999px;
}

/* Hide icon when configured */
.se-quick-view[data-show-icon="false"] .se-qv-icon {
    display: none;
}

/* Icon Only Mode (toggle control) */
.se-quick-view[data-icon-only="true"] .se-qv-text,
.se-quick-view.se-qv-icon-only .se-qv-text {
    display: none;
}

.se-quick-view[data-icon-only="true"],
.se-quick-view.se-qv-icon-only {
    padding: 0.75rem;
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

.se-quick-view[data-icon-only="true"][data-button-size="small"],
.se-quick-view.se-qv-icon-only[data-button-size="small"] {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

.se-quick-view[data-icon-only="true"][data-button-size="large"],
.se-quick-view.se-qv-icon-only[data-button-size="large"] {
    padding: 1rem;
    width: 56px;
    height: 56px;
}

/* ===================================
   QUICK VIEW MODAL
   =================================== */

.se-qv-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.se-qv-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Overlay */
.se-qv-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: qvFadeIn 0.3s ease;
}

/* Container Base */
.se-qv-container {
    position: relative;
    background: white;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Close Button */
.se-qv-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    color: #374151;
}

.se-qv-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

/* ===================================
   POPUP STYLE (centered modal)
   =================================== */

.se-qv-modal.se-qv-popup .se-qv-container {
    width: 90%;
    max-width: 900px;
    border-radius: 1rem;
    animation: qvPopupIn 0.3s ease;
}

@keyframes qvPopupIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===================================
   SLIDE-IN STYLE (left or right)
   =================================== */

.se-qv-modal.se-qv-slide-left .se-qv-container,
.se-qv-modal.se-qv-slide-right .se-qv-container {
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 450px;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
}

.se-qv-modal.se-qv-slide-left .se-qv-container {
    left: 0;
    animation: qvSlideInLeft 0.3s ease;
}

.se-qv-modal.se-qv-slide-right .se-qv-container {
    right: 0;
    animation: qvSlideInRight 0.3s ease;
}

@keyframes qvSlideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes qvSlideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ===================================
   MODAL CONTENT
   =================================== */

.se-qv-content {
    padding: 2rem;
}

/* Loading State */
.se-qv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #6b7280;
    gap: 1rem;
}

.se-qv-spinner {
    width: 3rem;
    height: 3rem;
    animation: qvSpin 1s linear infinite;
}

@keyframes qvSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error State */
.se-qv-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: #dc2626;
    gap: 1rem;
}

.se-qv-retry {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
}

.se-qv-retry:hover {
    background: #e5e7eb;
}

/* Product Layout */
.se-qv-product {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Popup: Side by side layout */
.se-qv-modal.se-qv-popup .se-qv-product {
    flex-direction: row;
    align-items: flex-start;
}

.se-qv-modal.se-qv-popup .se-qv-image {
    flex: 0 0 45%;
}

.se-qv-modal.se-qv-popup .se-qv-details {
    flex: 1;
    padding-left: 1.5rem;
}

/* Image */
.se-qv-image {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f9fafb;
}

.se-qv-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.se-qv-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: #dc2626;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

/* Details */
.se-qv-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.se-qv-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.se-qv-price {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.se-qv-price-old {
    font-size: 1rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.se-qv-price-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent, #16a34a);
}

.se-qv-description {
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.6;
}

.se-qv-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.se-qv-meta p {
    margin: 0;
}

.se-qv-meta strong {
    color: #111827;
}

.se-qv-in-stock {
    color: #16a34a;
    font-weight: 600;
}

.se-qv-out-of-stock {
    color: #dc2626;
    font-weight: 600;
}

/* Quantity Selector */
.se-qv-quantity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.se-qv-quantity label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.se-qv-qty-wrapper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.se-qv-qty-minus,
.se-qv-qty-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: #4b5563;
    transition: background 0.2s;
}

.se-qv-qty-minus:hover,
.se-qv-qty-plus:hover {
    background: #e5e7eb;
}

.se-qv-qty-input {
    width: 3rem;
    text-align: center;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    font-size: 1rem;
    padding: 0.5rem 0;
}

.se-qv-qty-input::-webkit-inner-spin-button,
.se-qv-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Actions */
.se-qv-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.se-qv-add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--primary, #2563eb);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.se-qv-add-cart:hover {
    background: var(--primary-dark, #1d4ed8);
    transform: translateY(-1px);
}

.se-qv-add-cart:active {
    transform: translateY(0);
}

.se-qv-view-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    color: var(--primary, #2563eb);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.se-qv-view-full:hover {
    color: var(--primary-dark, #1d4ed8);
    text-decoration: underline;
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes qvFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .se-qv-modal.se-qv-popup .se-qv-container {
        width: 95%;
        max-width: none;
    }
    
    .se-qv-modal.se-qv-popup .se-qv-product {
        flex-direction: column;
    }
    
    .se-qv-modal.se-qv-popup .se-qv-image {
        flex: none;
    }
    
    .se-qv-modal.se-qv-popup .se-qv-details {
        padding-left: 0;
    }
    
    .se-qv-modal.se-qv-slide-left .se-qv-container,
    .se-qv-modal.se-qv-slide-right .se-qv-container {
        max-width: 100%;
    }
    
    .se-qv-content {
        padding: 1.5rem;
    }
    
    .se-qv-title {
        font-size: 1.25rem;
    }
    
    .se-qv-price-current {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .se-qv-content {
        padding: 1rem;
    }
    
    .se-qv-quantity {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .se-qv-qty-wrapper {
        width: 100%;
        justify-content: center;
    }
    
    .se-qv-add-cart {
        width: 100%;
    }
}
