/**
 * LC Voucher Manager - Frontend Styles
 * Professional grid layout for voucher products
 */

/* ========================================
   VOUCHER PRODUCT LIST - GRID LAYOUT
   ======================================== */

.lc-vouchers-list {
    display: grid;
    /* Sloupce se nastavují přes Elementor nebo defaultní responsive hodnoty */
    grid-template-columns: repeat(3, 1fr); /* Default 3 sloupce - override přes Elementor */
    gap: 30px;
    margin: 40px 0;
    padding: 0;
    /* Zarovnání položek - důležité pro méně položek než sloupců */
    justify-items: start; /* Default vlevo - override přes Elementor */
}

/* Mobile: 1 column - můžete změnit v Elementor responsive settings */
@media (max-width: 767px) {
    .lc-vouchers-list {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 0;
    }
}

/* Tablet: 2 columns - můžete změnit v Elementor responsive settings */
@media (min-width: 768px) and (max-width: 1024px) {
    .lc-vouchers-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

/* Desktop: 3 columns - můžete změnit v Elementor responsive settings */
@media (min-width: 1025px) {
    .lc-vouchers-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

/* ========================================
   VOUCHER CARD
   ======================================== */

.lc-voucher-item {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%; /* Plná šířka grid buňky */
    max-width: 100%; /* Může být omezeno grid zarovnáním */
}

/* Pokud je grid zarovnaný vlevo/vpravo a položek je méně než sloupců,
   každá karta zabere celou šířku své grid buňky */
.lc-vouchers-list[style*="justify-items: start"] .lc-voucher-item,
.lc-vouchers-list[style*="justify-items: end"] .lc-voucher-item {
    width: 100%;
}

/* Při zarovnání na střed mohou být karty mírně užší pro lepší vzhled */
.lc-vouchers-list[style*="justify-items: center"] .lc-voucher-item {
    width: 100%;
}

.lc-voucher-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

/* ========================================
   IMAGE SECTION
   ======================================== */

.lc-voucher-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 aspect ratio */
    overflow: hidden;
    background: #f5f5f5;
}

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

.lc-voucher-item:hover .lc-voucher-image {
    transform: scale(1.05);
}

/* Badge (e.g. "Bestseller", "Novinka") */
.lc-voucher-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* ========================================
   CARD BODY
   ======================================== */

.lc-voucher-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.lc-voucher-title {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.lc-voucher-content {
    font-size: 15px;
    color: #718096;
    line-height: 1.6;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.lc-voucher-content p {
    margin: 0 0 10px 0;
}

.lc-voucher-content p:last-child {
    margin-bottom: 0;
}

/* ========================================
   PRICE
   ======================================== */

.lc-voucher-price {
    font-size: 32px;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 20px 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.lc-voucher-price-amount {
    color: #667eea;
}

.lc-voucher-price-currency {
    font-size: 18px;
    font-weight: 600;
    color: #4a5568;
}

/* ========================================
   ADD TO CART BUTTON
   ======================================== */

.lc-voucher-add-to-cart-form {
    margin: 0;
}

.lc-voucher-add-to-cart-button {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lc-voucher-add-to-cart-button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.lc-voucher-add-to-cart-button:active {
    transform: translateY(0);
}

/* ========================================
   ELEMENTOR WIDGET HEADER
   ======================================== */

.lc-voucher-elementor-widget {
    margin: 0;
    padding: 0;
}

.lc-voucher-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
    padding: 20px 0;
}

/* Base styles - nízká specificita aby Elementor mohl přepsat */
.lc-voucher-cart-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: #ffffff;
    border: 2px solid #667eea;
    border-radius: 10px;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    position: relative;
}

/* Hover state - použijeme !important jen pro animace které Elementor nenastavuje */
.lc-voucher-cart-button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    border-color: transparent;
}

.lc-voucher-cart-button:hover .lc-voucher-cart-icon {
    transform: scale(1.1);
}

.lc-voucher-cart-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
    line-height: 1;
}

.lc-voucher-cart-label {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.lc-voucher-cart-count {
    background: #ef4444;
    color: #ffffff;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    padding: 0 8px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Když je košík prázdný, skrýt badge */
.lc-voucher-cart-button .lc-voucher-cart-count:empty {
    display: none;
}

/* Zvýraznění když má košík položky */
.lc-voucher-cart-button:has(.lc-voucher-cart-count) {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

/* ========================================
   CUSTOM BUTTON SECTION
   ======================================== */

.lc-voucher-custom {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f6f8fb 0%, #e9ecef 100%);
    border-radius: 12px;
    text-align: center;
}

.lc-voucher-custom-button {
    display: inline-block;
    padding: 16px 32px;
    background: #2d3748;
    color: #ffffff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.lc-voucher-custom-button:hover {
    background: #1a202c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========================================
   STICKY CART (Mobile)
   ======================================== */

.lc-voucher-sticky-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

@media (min-width: 768px) {
    .lc-voucher-sticky-cart {
        display: none;
    }
}

.lc-voucher-sticky-cart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.lc-voucher-sticky-cart-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.lc-voucher-sticky-cart .lc-voucher-cart-icon {
    font-size: 24px;
}

.lc-voucher-sticky-cart .lc-voucher-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #ffffff;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ========================================
   CART PAGE STYLES
   ======================================== */

.lc-voucher-cart-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lc-voucher-cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 18px;
}

.lc-voucher-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.lc-voucher-cart-table th,
.lc-voucher-cart-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.lc-voucher-cart-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.lc-voucher-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.lc-voucher-cart-total {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
}

.lc-voucher-cart-total-amount {
    color: #667eea;
}

/* ========================================
   CHECKOUT STYLES
   ======================================== */

.lc-voucher-checkout-wrapper {
    max-width: 700px;
    margin: 40px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lc-voucher-checkout-form {
    margin: 0;
}

.lc-voucher-checkout-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.lc-voucher-checkout-form input[type="text"],
.lc-voucher-checkout-form input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.lc-voucher-checkout-form input[type="text"]:focus,
.lc-voucher-checkout-form input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
}

.lc-voucher-checkout-submit {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lc-voucher-checkout-submit:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ========================================
   LOADING & ANIMATIONS
   ======================================== */

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

.lc-voucher-item {
    animation: fadeIn 0.5s ease forwards;
}

/* Stagger animation for items */
.lc-voucher-item:nth-child(1) { animation-delay: 0.1s; }
.lc-voucher-item:nth-child(2) { animation-delay: 0.2s; }
.lc-voucher-item:nth-child(3) { animation-delay: 0.3s; }
.lc-voucher-item:nth-child(4) { animation-delay: 0.4s; }
.lc-voucher-item:nth-child(5) { animation-delay: 0.5s; }
.lc-voucher-item:nth-child(6) { animation-delay: 0.6s; }

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 767px) {
    .lc-voucher-cart-wrapper,
    .lc-voucher-checkout-wrapper {
        padding: 20px;
        margin: 20px;
    }
    
    .lc-voucher-price {
        font-size: 28px;
    }
    
    .lc-voucher-title {
        font-size: 20px;
    }
}

/* ========================================
   QUANTITY INPUT (simple number field)
   ======================================== */

.lc-voucher-quantity-wrap {
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.lc-voucher-quantity-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.lc-voucher-qty-input {
    width: 80px;
    height: 45px;
    padding: 8px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: #fff;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    transition: all 0.2s ease;
}

.lc-voucher-qty-input:focus {
    outline: none;
    border-color: #5568d3;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.lc-voucher-qty-input::-webkit-outer-spin-button,
.lc-voucher-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.lc-voucher-qty-input {
    -moz-appearance: textfield;
}

/* Mobile */
@media (max-width: 767px) {
    .lc-voucher-quantity-wrap {
        flex-direction: column;
        gap: 8px;
    }
    
    .lc-voucher-qty-input {
        width: 100%;
        max-width: 120px;
    }
}
