/**
 * Vitor Product Page Enhancer - Frontend Styles
 * Vitor.lt WooCommerce Design Overhaul & Visual Polish
 */

/* ==========================================================================
   1. MODERN TYPOGRAPHY & TYPE HIERARCHY (PLUS JAKARTA SANS)
   ========================================================================== */
body.single-product {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #334155;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Product Title */
.single-product .summary .product_title,
.single-product h1.product_title {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    line-height: 1.28 !important;
    letter-spacing: -0.025em !important;
    color: #0f172a !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
}

@media (max-width: 768px) {
    .single-product .summary .product_title,
    .single-product h1.product_title {
        font-size: 21px !important;
    }
}

/* Price Section */
.single-product .summary .price {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 24px !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 10px !important;
    margin: 12px 0 14px 0 !important;
    line-height: 1.2 !important;
}

.single-product .summary .price del {
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #94a3b8 !important;
    text-decoration: line-through !important;
}

.single-product .summary .price ins {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    text-decoration: none !important;
    letter-spacing: -0.02em !important;
}

/* Short Description */
.single-product .summary .woocommerce-product-details__short-description {
    font-size: 15px !important;
    line-height: 1.65 !important;
    color: #475569 !important;
    margin: 16px 0 20px 0 !important;
}

/* Cart & Add to Cart Button (Fit perfectly & match height) */
.single-product .summary form.cart {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin: 20px 0 !important;
}

.single-product .summary form.cart .quantity {
    display: inline-flex !important;
    align-items: stretch !important;
    margin: 0 !important;
    height: 48px !important;
}

.single-product .summary form.cart .quantity .qty {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    height: 48px !important;
    line-height: 48px !important;
    width: 52px !important;
    padding: 0 4px !important;
    text-align: center !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
}

.single-product .summary form.cart .quantity .minus,
.single-product .summary form.cart .quantity .plus {
    height: 48px !important;
    width: 42px !important;
    line-height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

.single-product .summary form.cart .quantity .minus:hover,
.single-product .summary form.cart .quantity .plus:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.single-product .summary form.cart .quantity .minus {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    border-right: none !important;
}

.single-product .summary form.cart .quantity .plus {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-left: none !important;
}

/* „Į krepšelį“ button - comfortable width, no text cutoff */
.single-product .summary form.cart .single_add_to_cart_button {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    border-radius: 8px !important;
    height: 48px !important;
    line-height: 48px !important;
    padding: 0 32px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: auto !important;
    min-width: 180px !important;
    box-sizing: border-box !important;
    background-color: #1e293b !important;
    color: #ffffff !important;
    border: none !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease !important;
}

.single-product .summary form.cart .single_add_to_cart_button:hover {
    background-color: #0f172a !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22) !important;
}

@media (max-width: 480px) {
    .single-product .summary form.cart .single_add_to_cart_button {
        padding: 0 20px !important;
        min-width: 150px !important;
        font-size: 13.5px !important;
    }
}

/* Product Meta (Categories, SKU) */
.single-product .product_meta {
    font-size: 13px;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
    margin-top: 20px;
}

.single-product .product_meta a {
    color: #0f766e;
    text-decoration: none;
    font-weight: 500;
}

.single-product .product_meta a:hover {
    text-decoration: underline;
}

/* Prevent duplicate stock badge anywhere: only the first badge under price stays visible */
.single-product .product_meta .vitor-stock-badge,
.single-product .product_meta .product-stock,
.single-product .product_meta .stock,
.single-product form.cart .vitor-stock-badge,
.single-product .summary .vitor-stock-badge ~ .vitor-stock-badge {
    display: none !important;
}

/* ==========================================================================
   2. VISUAL STOCK & URGENCY INDICATOR (PULSE BADGE)
   ========================================================================== */
.vitor-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    margin: 6px 0 16px 0;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease;
}

.vitor-stock-text strong {
    font-weight: 700;
}

/* Normal in stock: Emerald Pulse */
.vitor-stock-badge.vitor-stock-in-stock {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.vitor-pulse-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.vitor-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    z-index: 2;
}

.vitor-pulse-ring {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.4);
    animation: vitorPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    z-index: 1;
}

@keyframes vitorPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.9;
    }
    70% {
        transform: scale(2.3);
        opacity: 0;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Low stock: Amber/Orange Fire Alert */
.vitor-stock-badge.vitor-stock-low-stock {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    animation: vitorGlow 2.5s ease-in-out infinite alternate;
}

.vitor-stock-fire {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

@keyframes vitorGlow {
    0% {
        box-shadow: 0 1px 3px rgba(234, 88, 12, 0.05);
    }
    100% {
        box-shadow: 0 3px 12px rgba(234, 88, 12, 0.2);
    }
}

/* Out of stock: Soft Slate */
.vitor-stock-badge.vitor-stock-out-of-stock {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #64748b;
}

.vitor-dot-gray {
    width: 8px;
    height: 8px;
    background-color: #94a3b8;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ==========================================================================
   3. HIDE EMPTY REVIEWS & 0-STAR RATING
   ========================================================================== */
.woocommerce-product-rating .review-link.noreview,
.woocommerce-product-rating:has(.noreview),
.woocommerce-product-rating:has(.star-rating[title="0"]),
.single-product .summary .woocommerce-product-rating:has(span[style*="width:0%"]),
.single-product .summary .woocommerce-product-rating:has(span[style*="width: 0%"]) {
    display: none !important;
}

.single-product .review-link.noreview {
    display: none !important;
}

/* ==========================================================================
   4. TRUST & SHIPPING BADGES (BELOW ADD TO CART)
   ========================================================================== */
.vitor-trust-badges-wrapper {
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.25s ease;
}

.vitor-trust-badges-wrapper:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.vitor-trust-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 16px;
}

@media (max-width: 576px) {
    .vitor-trust-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.vitor-badge-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vitor-badge-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    color: #0f766e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, color 0.2s ease;
}

.vitor-badge-item:hover .vitor-badge-icon {
    transform: scale(1.05);
    color: #0d9488;
}

.vitor-badge-content {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.vitor-badge-content strong {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.vitor-badge-content span {
    font-size: 11.5px;
    color: #64748b;
}

/* ==========================================================================
   5. RESPONSIVE VIDEO CONTAINER
   ========================================================================== */
.vitor-video-container {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 24px auto;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    background: #0f172a;
}

.vitor-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 12px;
}

/* ==========================================================================
   6. PRODUCT TABS & CONTENT TYPOGRAPHY
   ========================================================================== */
.single-product .woocommerce-tabs .resp-tabs-list li {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    color: #475569 !important;
    transition: color 0.2s ease;
}

.single-product .woocommerce-tabs .resp-tabs-list li.resp-tab-active {
    color: #0f172a !important;
    border-bottom-color: #0f766e !important;
}

.single-product #tab-description {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
}

.single-product #tab-description h2 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-top: 30px !important;
    margin-bottom: 14px !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid #f1f5f9 !important;
    letter-spacing: -0.02em !important;
}

.single-product #tab-description h2:first-of-type {
    margin-top: 0 !important;
}

.single-product #tab-description ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 22px;
}

.single-product #tab-description ul li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 10px;
    line-height: 1.65;
}

.single-product #tab-description ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 2px;
    width: 17px;
    height: 17px;
    font-size: 11px;
    font-weight: 700;
    color: #0d9488;
    background: #ccfbf1;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Feature Box Helper */
.vitor-feature-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #16a34a;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 22px 0;
}

.vitor-feature-box p {
    margin: 0;
    color: #166534;
    font-size: 14px;
}

/* Attributes / Specifications Table */
.single-product #tab-additional_information table.shop_attributes {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.single-product #tab-additional_information table.shop_attributes th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 16px;
}

.single-product #tab-additional_information table.shop_attributes td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

.single-product #tab-additional_information table.shop_attributes tr:last-child th,
.single-product #tab-additional_information table.shop_attributes tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   7. HOMEPAGE & CATALOG LOOP DESIGN REFRESH
   ========================================================================== */
body.home {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Homepage Section Headings (Kategorijos, Ypatingi pasiūlymai, etc.) */
.home h2.vc_custom_heading,
.vc_custom_heading.heading-tag {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: #0f172a !important;
    position: relative;
    padding-bottom: 12px;
}

.home h2.vc_custom_heading::after {
    content: '';
    display: block;
    width: 42px;
    height: 3px;
    background: #0d9488;
    border-radius: 9999px;
    margin: 8px auto 0 auto;
}

/* Homepage Hero Interactive Banners */
.home .porto-ibanner {
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
}

.home .porto-ibanner .heading-tag a {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    background: #0f172a !important;
    color: #ffffff !important;
    padding: 10px 24px !important;
    border-radius: 9999px !important;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25) !important;
    transition: all 0.2s ease !important;
    display: inline-block !important;
}

.home .porto-ibanner .heading-tag a:hover {
    background: #0d9488 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35) !important;
}

/* Category Cards on Homepage */
.home ul.products li.product-category .thumb-info {
    border-radius: 14px !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.home ul.products li.product-category:hover .thumb-info {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.08) !important;
    border-color: #cbd5e1 !important;
}

.home ul.products li.product-category .thumb-info img {
    border-radius: 14px 14px 0 0 !important;
    transition: transform 0.4s ease !important;
}

.home ul.products li.product-category:hover .thumb-info img {
    transform: scale(1.05) !important;
}

.home ul.products li.product-category .thumb-info-title {
    background: #ffffff !important;
    padding: 12px 14px !important;
    border-top: 1px solid #f1f5f9 !important;
    text-align: center !important;
}

.home ul.products li.product-category .thumb-info h3.sub-title {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em !important;
}

/* Product Grid & Cards (Homepage & Catalog) */
ul.products li.product .product-inner,
.home .porto-posts-grid ul.products li.product-col .product-inner {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 12px !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

ul.products li.product:hover .product-inner,
.home .porto-posts-grid ul.products li.product-col:hover .product-inner {
    transform: translateY(-4px) !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.08) !important;
}

/* Product Card Images - overflow visible to prevent tooltip clipping */
ul.products li.product .product-image,
.home .porto-posts-grid ul.products li.product-col .product-image {
    position: relative !important;
    border-radius: 10px !important;
    overflow: visible !important;
}

ul.products li.product .product-image img,
.home .porto-posts-grid ul.products li.product-col .product-image img {
    border-radius: 10px !important;
    transition: transform 0.35s ease !important;
    display: block !important;
    width: 100% !important;
}

ul.products li.product:hover .product-image img,
.home .porto-posts-grid ul.products li.product-col:hover .product-image img {
    transform: scale(1.03) !important;
}

/* Position links-on-image comfortably inside image corner */
ul.products li.product .links-on-image,
.home .porto-posts-grid ul.products li.product-col .links-on-image {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 25 !important;
    overflow: visible !important;
}

/* Circular Add to Cart button in card overlay (Perfect centering & circle geometry) */
ul.products li.product .links-on-image .add_to_cart_button,
.home .porto-posts-grid ul.products li.product-col .links-on-image .add_to_cart_button {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    line-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    background-color: #0f766e !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18) !important;
    font-size: 0 !important;
    text-indent: 0 !important;
    border: none !important;
    cursor: pointer !important;
    overflow: visible !important;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease !important;
}

ul.products li.product .links-on-image .add_to_cart_button:hover,
.home .porto-posts-grid ul.products li.product-col .links-on-image .add_to_cart_button:hover {
    background-color: #0d9488 !important;
    transform: scale(1.08) !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35) !important;
}

/* Center icon perfectly inside circle */
ul.products li.product .links-on-image .add_to_cart_button::before,
.home .porto-posts-grid ul.products li.product-col .links-on-image .add_to_cart_button::before {
    font-size: 15px !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    position: static !important;
    color: #ffffff !important;
}

/* Hide awkward / redundant Quickview overlay on product cards */
ul.products li.product .quickview,
.home .porto-posts-grid ul.products li.product-col .quickview,
.links-on-image .quickview {
    display: none !important;
}

/* Ensure tooltips float cleanly with proper z-index */
.tooltip,
.porto-tooltip,
.bs-tooltip-top,
.bs-tooltip-bottom,
.bs-tooltip-start,
.bs-tooltip-end {
    z-index: 99999 !important;
    pointer-events: none !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 11px !important;
}
