/**
 * Lisenziya.az - Mobile-First Popup & Grid Styles
 * Version: 1.0.0
 * Date: 2026-01-17
 */

/* ============================================
   PRODUCT GRID - Mobile First
   ============================================ */

.lz-product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
    margin: 0;
}

.lz-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
}

.lz-product-card:active {
    transform: scale(0.98);
}

.lz-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.lz-product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #f8f9fa;
}

.lz-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lz-product-card:hover .lz-product-image img {
    transform: scale(1.05);
}

.lz-product-info {
    padding: 12px;
}

.lz-product-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #2c3e50;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 34px;
}

.lz-product-price-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lz-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #e74c3c;
}

.lz-product-price-old {
    font-size: 12px;
    color: #95a5a6;
    text-decoration: line-through;
}

.lz-product-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1;
}

/* ============================================
   POPUP OVERLAY & ANIMATION
   ============================================ */

.lz-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: background-color 0.3s ease;
    padding: 0;
}

.lz-popup-overlay.active {
    background: rgba(0, 0, 0, 0.85);
}

.lz-popup-content {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
}

.lz-popup-overlay.active .lz-popup-content {
    transform: translateY(0);
}

/* ============================================
   POPUP CLOSE BUTTON
   ============================================ */

.lz-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.lz-popup-close:active {
    transform: scale(0.9);
    background: rgba(0, 0, 0, 0.8);
}

/* ============================================
   POPUP IMAGE
   ============================================ */

.lz-popup-image {
    width: 100%;
    max-height: 40vh;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

.lz-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ============================================
   POPUP BODY
   ============================================ */

.lz-popup-body {
    padding: 20px;
}

.lz-popup-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #2c3e50;
    margin: 0 0 16px 0;
}

.lz-popup-price {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.lz-price-current,
.lz-price-special {
    font-size: 28px;
    font-weight: 800;
    color: #e74c3c;
}

.lz-price-old {
    font-size: 20px;
    color: #95a5a6;
    text-decoration: line-through;
    font-weight: 500;
}

.lz-popup-short-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #5a6c7d;
    margin: 0 0 20px 0;
}

/* ============================================
   WHATSAPP BUTTON
   ============================================ */

.lz-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    color: #fff;
    text-align: center;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    transition: all 0.2s ease;
}

.lz-whatsapp-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.4);
}

.lz-whatsapp-btn svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   DETAILS/ACCORDION
   ============================================ */

/* ============================================
   ACCORDION
   ============================================ */

.lz-accordion {
    border-top: 1px solid #f1f2f6;
    margin-top: 20px;
}

.lz-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    transition: color 0.2s ease;
    text-align: left;
}

.lz-accordion-header:hover {
    color: #e74c3c;
}

.lz-accordion-title {
    position: relative;
    padding-left: 12px;
}

.lz-accordion-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    background: #e74c3c;
    border-radius: 2px;
}

.lz-accordion-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #95a5a6;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.lz-accordion-header.active .lz-accordion-icon {
    transform: rotate(180deg);
    color: #e74c3c;
}

.lz-accordion-content {
    height: 0;
    overflow: hidden;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-10px);
}

.lz-accordion-content.active {
    opacity: 1;
    transform: translateY(0);
}

.lz-accordion-inner {
    padding-bottom: 24px;
    color: #5a6c7d;
    font-size: 14px;
    line-height: 1.7;
}

/* Accordion Content Typography */
.lz-accordion-inner p {
    margin-bottom: 12px;
}

.lz-accordion-inner ul,
.lz-accordion-inner ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

.lz-accordion-inner li {
    margin-bottom: 6px;
    position: relative;
}

.lz-accordion-inner strong,
.lz-accordion-inner b {
    color: #2c3e50;
    font-weight: 600;
}

/* Custom scrollbar for long description */
.lz-accordion-inner::-webkit-scrollbar {
    width: 6px;
}

.lz-accordion-inner::-webkit-scrollbar-thumb {
    background-color: #cbd5e0;
    border-radius: 3px;
}

.lz-popup-full-desc {
    padding: 16px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #5a6c7d;
}

.lz-popup-full-desc h1,
.lz-popup-full-desc h2,
.lz-popup-full-desc h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.lz-popup-full-desc ul,
.lz-popup-full-desc ol {
    padding-left: 20px;
    margin: 10px 0;
}

/* ============================================
   LOADER
   ============================================ */

.lz-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lz-loader-spinner {
    color: #fff;
}

/* ============================================
   ERROR TOAST
   ============================================ */

.lz-error-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 100000;
    transition: bottom 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.lz-error-toast.show {
    bottom: 20px;
}

/* ============================================
   STICKY WHATSAPP FLOAT
   ============================================ */

.lz-whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 9998;
    text-decoration: none;
    animation: lz-pulse 2s infinite;
    transition: transform 0.2s ease;
}

.lz-whatsapp-float:active {
    transform: scale(0.95);
}

.lz-whatsapp-float svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

@keyframes lz-pulse {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    }

    50% {
        box-shadow: 0 4px 24px rgba(37, 211, 102, 0.6);
    }
}

/* ============================================
   TABLET & DESKTOP
   ============================================ */

@media (min-width: 768px) {
    .lz-product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        padding: 16px;
    }

    .lz-product-name {
        font-size: 14px;
    }

    .lz-product-info {
        padding: 16px;
    }

    .lz-popup-overlay {
        align-items: center;
        padding: 20px;
    }

    .lz-popup-content {
        border-radius: 20px;
        max-width: 560px;
        max-height: 90vh;
        transform: scale(0.9);
        opacity: 0;
    }

    .lz-popup-overlay.active .lz-popup-content {
        transform: scale(1);
        opacity: 1;
    }

    .lz-popup-close:hover {
        background: rgba(0, 0, 0, 0.8);
        transform: rotate(90deg);
    }

    .lz-whatsapp-btn:hover {
        background: linear-gradient(135deg, #20BA5A 0%, #1DA851 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
    }

    .lz-whatsapp-float:hover {
        transform: scale(1.1);
    }
}

@media (min-width: 1200px) {
    .lz-product-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
        padding: 20px;
    }

    .lz-product-card {
        border-radius: 16px;
    }
}

/* ============================================
   SMOOTH SCROLLING & CUSTOM SCROLLBAR
   ============================================ */

.lz-popup-content {
    scroll-behavior: smooth;
    overflow-y: auto;

    /* Desktop: Prevent layout shift */
    @media (min-width: 1024px) {
        scrollbar-gutter: stable;
        overflow-y: overlay;
    }

    /* Mobile: Native behavior */
    -webkit-overflow-scrolling: touch;

    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

/* Webkit (Chrome, Safari, Edge) */
.lz-popup-content::-webkit-scrollbar {
    width: 5px;
}

.lz-popup-content::-webkit-scrollbar-track {
    background: transparent;
}

.lz-popup-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e0;
    border-radius: 10px;
    border: none;
}

.lz-popup-content::-webkit-scrollbar-thumb:hover {
    background-color: #a0aec0;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.lz-popup-close:focus,
.lz-whatsapp-btn:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* Reduce motion for users with preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {

    .lz-popup-overlay,
    .lz-whatsapp-float,
    .lz-loader {
        display: none !important;
    }
}