/**
 * Zdrowotka Quick View v1.0 - Frontend styles
 * Brand: #2E7D32 (zielony), font Inter
 * Mobile: 44px tap targets (iOS HIG)
 * Layout: oko obok wishlist (top-right, right:60px gdy wishlist na right:8px)
 */

/* ════════════════════════════════════════════════════
   BUTTON na karcie produktu (obok wishlist)
   ════════════════════════════════════════════════════ */

ul.products li.product,
.zd-grid-item { position: relative; }

.zd-qv-btn {
    position: absolute;
    top: 8px;
    right: 60px;  /* 44px wishlist + 8px gap + 8px margin */
    z-index: 5;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: 1.5px solid #e0e0e0;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.zd-qv-btn .zd-qv-icon {
    width: 20px;
    height: 20px;
    color: #999;
    transition: color 0.18s ease, transform 0.18s ease;
}
.zd-qv-btn:hover,
.zd-qv-btn:focus-visible {
    border-color: #2E7D32;
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(46,125,50,0.18);
    outline: none;
}
.zd-qv-btn:hover .zd-qv-icon,
.zd-qv-btn:focus-visible .zd-qv-icon {
    color: #2E7D32;
}
.zd-qv-btn:active .zd-qv-icon {
    transform: scale(0.92);
}

/* Mobile: mniejszy button (40px), shift'owany żeby zostawić miejsce dla wishlist */
@media (max-width: 768px) {
    .zd-qv-btn {
        width: 40px;
        height: 40px;
        top: 6px;
        right: 52px;  /* 40px wishlist + 6px gap + 6px margin */
    }
    .zd-qv-btn .zd-qv-icon {
        width: 18px;
        height: 18px;
    }
}

/* ════════════════════════════════════════════════════
   MODAL OVERLAY
   ════════════════════════════════════════════════════ */

.zd-qv-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}
.zd-qv-overlay.is-visible {
    display: flex;
    align-items: center;
    justify-content: center;
}
.zd-qv-overlay.is-active {
    opacity: 1;
}

body.zd-qv-open {
    overflow: hidden;
}

/* ════════════════════════════════════════════════════
   MODAL CONTAINER
   ════════════════════════════════════════════════════ */

.zd-qv-modal {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    font-family: "Inter", sans-serif;
    display: flex;
    flex-direction: column;
}
.zd-qv-overlay.is-active .zd-qv-modal {
    transform: scale(1);
}

/* Close button */
.zd-qv-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 40px;
    height: 40px;
    padding: 0;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 50%;
    color: #555;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-family: inherit;
}
.zd-qv-close:hover,
.zd-qv-close:focus-visible {
    border-color: #d32f2f;
    color: #d32f2f;
    outline: none;
}

/* Loading state */
.zd-qv-loading {
    padding: 80px 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}
.zd-qv-loading::before {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #2E7D32;
    border-radius: 50%;
    animation: zd-qv-spin 0.8s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}
@keyframes zd-qv-spin {
    to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════
   PRODUCT CONTENT
   ════════════════════════════════════════════════════ */

.zd-qv-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.zd-qv-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 400px;
}

/* Galeria - lewa kolumna */
.zd-qv-gallery {
    background: #fafafa;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.zd-qv-gallery img {
    max-width: 100%;
    max-height: 360px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Badge w galerii (np. Promocja, Nowość) */
.zd-qv-gallery-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 12px;
    background: #d97706;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.zd-qv-gallery-badge--sale { background: #d97706; }
.zd-qv-gallery-badge--new { background: #2E7D32; }
.zd-qv-gallery-badge--oos { background: #999; }

/* Info - prawa kolumna */
.zd-qv-info {
    padding: 36px 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zd-qv-category {
    display: inline-block;
    padding: 4px 12px;
    background: #f0faf0;
    color: #2E7D32;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 20px;
    align-self: flex-start;
}

.zd-qv-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}
.zd-qv-title a {
    color: #1a1a1a;
    text-decoration: none;
}
.zd-qv-title a:hover { color: #2E7D32; }

.zd-qv-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}
.zd-qv-rating-stars {
    color: #f59e0b;
    font-size: 14px;
    letter-spacing: 1px;
}
.zd-qv-rating-count {
    color: #666;
}

.zd-qv-price {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}
.zd-qv-price ins {
    color: #d97706;
    text-decoration: none;
}
.zd-qv-price del {
    color: #999;
    font-size: 17px;
    font-weight: 400;
    margin-right: 8px;
}

.zd-qv-shipping {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0faf0;
    color: #2E7D32;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    align-self: flex-start;
}
.zd-qv-shipping svg {
    width: 14px;
    height: 14px;
}

.zd-qv-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    max-height: 6.4em;
    overflow: hidden;
    margin: 0;
}

.zd-qv-out-of-stock {
    padding: 12px 16px;
    background: #f5f5f5;
    color: #999;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
}

/* Variations (variable products) */
.zd-qv-variations {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.zd-qv-variation-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.zd-qv-variation-row label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.zd-qv-variation-row select {
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a1a;
    background: #fff;
    cursor: pointer;
    min-height: 44px;
    font-family: inherit;
}
.zd-qv-variation-row select:focus {
    border-color: #2E7D32;
    outline: none;
}

/* Actions row: quantity + ATC */
.zd-qv-actions {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.zd-qv-qty {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.zd-qv-qty-btn {
    width: 44px;
    height: 48px;
    padding: 0;
    background: #fff;
    border: none;
    color: #555;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.zd-qv-qty-btn:hover { background: #f0faf0; color: #2E7D32; }
.zd-qv-qty-btn:disabled { color: #ccc; cursor: not-allowed; }
.zd-qv-qty-input {
    width: 50px;
    height: 48px;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    background: #fff;
    -moz-appearance: textfield;
    font-family: inherit;
}
.zd-qv-qty-input::-webkit-outer-spin-button,
.zd-qv-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.zd-qv-atc {
    flex: 1;
    min-height: 48px;
    padding: 12px 24px;
    background: #2E7D32;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}
.zd-qv-atc:hover {
    background: #1B5E20;
    color: #fff;
}
.zd-qv-atc:disabled,
.zd-qv-atc.is-loading {
    opacity: 0.7;
    cursor: wait;
}
.zd-qv-atc svg {
    width: 16px;
    height: 16px;
}

/* Wishlist + Pelny opis row */
.zd-qv-secondary {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.zd-qv-fulldetails {
    color: #2E7D32;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.18s;
}
.zd-qv-fulldetails:hover {
    color: #1B5E20;
    text-decoration: underline;
}
.zd-qv-fulldetails::after {
    content: '→';
    transition: transform 0.18s;
}
.zd-qv-fulldetails:hover::after {
    transform: translateX(3px);
}

/* Wishlist button w modalu (osobny od głównego, używa tych samych klas) */
.zd-qv-secondary .zd-wl-btn--single {
    margin-top: 0;
}

/* ════════════════════════════════════════════════════
   MOBILE responsive
   ════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .zd-qv-overlay {
        padding: 0;
    }
    .zd-qv-modal {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .zd-qv-product {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .zd-qv-gallery {
        padding: 20px;
        min-height: 260px;
    }
    .zd-qv-gallery img {
        max-height: 240px;
    }
    .zd-qv-info {
        padding: 20px;
        padding-bottom: 30px;
    }
    .zd-qv-title {
        font-size: 18px;
    }
    .zd-qv-price {
        font-size: 22px;
    }
    .zd-qv-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    .zd-qv-atc {
        font-size: 13px;
        padding: 12px 16px;
    }
}
