/* ============================================================================
 * CASA CUIR - Quick View & Quick Add Enhancements
 * 
 * Enhances the existing Amerce/Themesflat Quick View using NATIVE theme classes.
 * Renders use: .tf-product-quick_view, .product-infor-price, .badge-sale,
 * .quick-variant-picker, .size_btn, .color_btn, .wg-quantity, .btn-quantity,
 * .tf-btn, .group-action, .product-mini-view, etc.
 * 
 * This file only adds what the theme doesn't cover.
 * ============================================================================ */

/* ============================================================================
 * QUICK VIEW OFFCANVAS - Enhanced layout
 * ============================================================================ */

.canvas-quickview.show {
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
}

/* Image gallery: keep theme .image class but enhance */
.canvas-quickview .wrap-quick .image {
    overflow: hidden;
}

.canvas-quickview .wrap-quick .image img {
    transition: transform 0.5s ease;
}

.canvas-quickview .wrap-quick .image img:hover {
    transform: scale(1.04);
}

/* Header close button enhancement */
#quickView .icon-close-popup {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#quickView .icon-close-popup:hover {
    background: var(--text);
    color: var(--white);
}

/* ============================================================================
 * PRODUCT INFO ENHANCEMENTS
 * ============================================================================ */

/* Category badge */
.tf-product-quick_view .product-infor-cate {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(149, 193, 31, 0.08);
    padding: 4px 12px;
    border-radius: 4px;
}

/* Product name */
.tf-product-quick_view .product-infor-name {
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Price block enhancement */
.tf-product-quick_view .product-infor-price {
    padding: 14px 16px;
    background: var(--bg);
    border-radius: 10px;
    flex-wrap: wrap;
}

.tf-product-quick_view .product-infor-price h4,
.tf-product-quick_view .product-infor-price .price-on-sale {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1;
}

.tf-product-quick_view .product-infor-price .badge-sale {
    background: var(--critical);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
}

/* Stock indicator with colored badges */
.tf-product-quick_view .product-infor-meta .stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
}

.tf-product-quick_view .product-infor-meta .stock-badge.in-stock {
    background: rgba(61, 171, 37, 0.1);
    color: #1d770b;
}

.tf-product-quick_view .product-infor-meta .stock-badge.out-of-stock {
    background: rgba(240, 62, 62, 0.1);
    color: var(--critical);
}

/* Description enhancement - allow more text */
.tf-product-quick_view .product-infor-desc {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================================
 * VARIANT PICKER ENHANCEMENTS
 * ============================================================================ */

/* Enhance size buttons in quickview context */
.tf-product-quick_view .quick-variant-picker .size_btn {
    min-width: 48px;
    border-radius: 6px;
    transition: all 0.25s ease;
}

.tf-product-quick_view .quick-variant-picker .size_btn.active {
    box-shadow: 0 2px 6px rgba(16, 16, 16, 0.12);
}

/* Color circles — modern design */
.tf-product-quick_view .quick-variant-picker .color_btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 50%;
    padding: 3px;
    border: 2px solid transparent;
    transition: border-color 0.25s ease, transform 0.2s ease;
}
.tf-product-quick_view .quick-variant-picker .color_btn .img {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.25s ease;
}
.tf-product-quick_view .quick-variant-picker .color_btn:hover {
    border-color: var(--text-2, #999);
    transform: scale(1.1);
}
.tf-product-quick_view .quick-variant-picker .color_btn:hover .img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.tf-product-quick_view .quick-variant-picker .color_btn.active {
    border-color: var(--text, #1a1a1a);
}
.tf-product-quick_view .quick-variant-picker .color_btn.active .img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
/* Tooltip */
.tf-product-quick_view .quick-variant-picker .color_btn::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--text, #1a1a1a);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}
.tf-product-quick_view .quick-variant-picker .color_btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================================
 * PRODUCT ATTRIBUTES TABLE (non-variant attributes)
 * ============================================================================ */

.tf-product-quick_view .tf-product-attrs {
    display: grid;
    gap: 0;
}

.tf-product-quick_view .tf-product-attrs .attr-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
}

.tf-product-quick_view .tf-product-attrs .attr-row:last-child {
    border-bottom: none;
}

.tf-product-quick_view .tf-product-attrs .attr-label {
    font-weight: 600;
    color: var(--text);
    min-width: 100px;
    flex-shrink: 0;
}

.tf-product-quick_view .tf-product-attrs .attr-value {
    color: var(--text-2);
}

/* ============================================================================
 * DELIVERY & TRUST SIGNALS (Quick View specific)
 * ============================================================================ */

.tf-product-quick_view .qv-trust-signals {
    display: grid;
    gap: 8px;
    padding: 14px;
    background: var(--bg);
    border-radius: 10px;
}

.tf-product-quick_view .qv-trust-signals .trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-2);
}

.tf-product-quick_view .qv-trust-signals .trust-item .icon {
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

/* ============================================================================
 * DOCUMENTS & VIDEOS
 * ============================================================================ */

.tf-product-quick_view .tf-product-docs,
.tf-product-quick_view .tf-product-videos {
    display: grid;
    gap: 6px;
}

.tf-product-quick_view .tf-product-docs a,
.tf-product-quick_view .tf-product-videos a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg);
    transition: all 0.2s ease;
    text-decoration: none;
}

.tf-product-quick_view .tf-product-docs a:hover,
.tf-product-quick_view .tf-product-videos a:hover {
    background: rgba(149, 193, 31, 0.1);
    color: var(--primary);
}

.tf-product-quick_view .tf-product-docs a .icon,
.tf-product-quick_view .tf-product-videos a .icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* ============================================================================
 * VIEW FULL DETAILS LINK
 * ============================================================================ */

.tf-product-quick_view .box-action .tf-btn-line-2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.tf-product-quick_view .box-action .tf-btn-line-2:hover {
    color: var(--primary);
}

.tf-product-quick_view .box-action .tf-btn-line-2 .arrow-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.tf-product-quick_view .box-action .tf-btn-line-2:hover .arrow-icon {
    transform: translateX(4px);
}

/* ============================================================================
 * QUICK ADD MODAL ENHANCEMENTS
 * ============================================================================ */

#quickAdd .modal-content {
    border: none;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

/* ============================================================================
 * RESPONSIVE - MOBILE FIRST
 * ============================================================================ */

@media (max-width: 767px) {
    /* Quick View full width on mobile */
    #quickView {
        width: 100vw !important;
    }

    .tf-product-quick_view .product-infor-price h4,
    .tf-product-quick_view .product-infor-price .price-on-sale {
        font-size: 22px;
    }

    .tf-product-quick_view .product-infor-price {
        padding: 12px;
    }

    /* Quick Add */
    #quickAdd .modal-dialog {
        margin: 8px;
    }
}

@media (min-width: 768px) {
    .tf-product-quick_view .product-infor-price h4,
    .tf-product-quick_view .product-infor-price .price-on-sale {
        font-size: 28px;
    }
}

@media (min-width: 1200px) {
    .tf-product-quick_view .product-infor-price h4,
    .tf-product-quick_view .product-infor-price .price-on-sale {
        font-size: 30px;
    }
}

/* ============================================================================
 * SUBTLE ANIMATIONS
 * ============================================================================ */

@keyframes qvSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#js-qv-body > * {
    animation: qvSlideUp 0.35s ease both;
}
#js-qv-body > *:nth-child(2) { animation-delay: 0.04s; }
#js-qv-body > *:nth-child(3) { animation-delay: 0.08s; }
#js-qv-body > *:nth-child(4) { animation-delay: 0.12s; }
#js-qv-body > *:nth-child(5) { animation-delay: 0.16s; }
#js-qv-body > *:nth-child(6) { animation-delay: 0.20s; }
#js-qv-body > *:nth-child(7) { animation-delay: 0.24s; }
#js-qv-body > *:nth-child(8) { animation-delay: 0.28s; }
#js-qv-body > *:nth-child(9) { animation-delay: 0.32s; }
#js-qv-body > *:nth-child(10) { animation-delay: 0.36s; }
