/**
 * PRODUCT CARD CSS - POPRAWIONY
 * Plik: assets/css/product-card.css
 */

/* ==========================================
   1. KARTA PRODUKTU - LAYOUT VERTICAL
   ========================================== */

.custom-product-card {
    position: relative;
    width: 100%;
    max-width: 250px;
}

.custom-product-card.layout-vertical {
    display: flex;
    flex-direction: column;
}

/* ==========================================
   2. KONTENER ZDJĘCIA - 215x215px
   ========================================== */

.product-image-container {
    position: relative;
    width: 215px;
    height: 215px;
    border-radius: 10px;
    border: 1px dashed #E5E5E5;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    background-color:#fff;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
  
}

.product-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

/* ==========================================
   3. HOVER - Border + Pokazanie akcji
   ========================================== */

.custom-product-card:hover .product-image-container {
    border-color: #FDA635;
}

/* ==========================================
   4. SALE BADGE - Lewy górny róg
   ========================================== */

.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #BC8FF7;
    color: #FFFFFF;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 5px;
    z-index: 10;
}

/* ==========================================
   5. IKONY AKCJI - POPRAWIONE!
   ========================================== */

.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 15;
}

.custom-product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

/* Button */
.action-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 !important;
}

.action-icon:hover {
    background: #FDA635;
    border-color: #FDA635;
    transform: scale(1.1);
}

/* SVG w środku */
.action-icon svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    display: block !important;
    fill: #333333;
    transition: fill 0.3s ease;
}

.action-icon:hover svg {
    fill: #FFFFFF;
}

/* Gdy dodane - pomarańczowe tło */
.action-icon.added {
    background: #FDA635 !important;
    border-color: #FDA635 !important;
}

.action-icon.added svg {
    fill: #FFFFFF !important;
}

/* Pokazuj zawsze gdy dodane */
.custom-product-card .action-icon.added {
    opacity: 1 !important;
}

.custom-product-card:not(:hover) .product-actions {
    opacity: 0;
}

.custom-product-card:not(:hover) .action-icon.added {
    opacity: 1 !important;
}

/* Loading state */
.action-icon.loading {
    pointer-events: none;
    opacity: 0.5;
}

/* Placeholder dla ikon - USUŃ gdy dodasz SVG */
.icon-placeholder {
    font-size: 14px !important;
    line-height: 1 !important;
    display: block !important;
}

/* ==========================================
   6. PRZYCISK DODAJ DO KOSZYKA - Dół (hover)
   ========================================== */

.add-to-cart-wrapper {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 15;
}

.custom-product-card:hover .add-to-cart-wrapper {
    opacity: 1;
}

/* Komunikat "Dodano do koszyka" - USUNIĘTY (będzie toast) */
.added-to-cart-message {
    display: none !important;
}

/* Przycisk */
.add-to-cart-button {
    width: 100%;
    height: 39px;
    background: #FDA635;
    border: none;
    border-radius: 50px;
    color: #FFFFFF;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}
/* ==========================================
   PRZYCISK "WYBIERZ OPCJE" = TEN SAM STYL
   ========================================== */

.choose-options-button {
    display: block;
    width: 100%;
    height: 39px;
    background: #FDA635;
    border-radius: 50px;
    color: #FFFFFF !important;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    text-align: center;
    line-height: 39px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.choose-options-button:hover {
    background: #FF6B35;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 166, 53, 0.4);
}

/* Ukryj wrapper przycisku dodaj do koszyka
   dla produktów z wariantami */
.custom-product-card .choose-options-button {
    display: block;
}


.add-to-cart-button:hover {
    background: #FF6B35;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 166, 53, 0.4);
}

.add-to-cart-button.in-cart {
    background: #4CAF50;
}

/* Loading state */
.add-to-cart-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.add-to-cart-button.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   7. INFORMACJE O PRODUKCIE
   ========================================== */

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

/* Cena */
.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.price-current {
    color: #FDA635;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.price-regular {
    color: #666666;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    text-decoration: line-through;
}

/* Tytuł */
.product-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    color: #333333;
    line-height: 1.4;
}

.product-title a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #FDA635;
}

/* Oceny */
.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 13px;
    line-height: 1;
}

.star.filled {
    color: #EFC576;
}

.star.empty {
    color: #E5E5E5;
}

.rating-count {
    color: #666666;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
}

/* ==========================================
   8. LAYOUT HORIZONTAL
   ========================================== */

.custom-product-card.layout-horizontal {
    display: flex;
    flex-direction: row;
    max-width: 100%;
    gap: 20px;
    align-items: flex-start;
}

.layout-horizontal .product-image-container {
    flex-shrink: 0;
}

.layout-horizontal .product-info {
    flex: 1;
    padding: 0;
}

.layout-horizontal .product-title {
    font-size: 18px;
    margin-bottom: 12px;
}

.layout-horizontal .product-price {
    margin-bottom: 12px;
}

/* ==========================================
   9. TOAST NOTIFICATIONS - POPRAWIONY
   ========================================== */
.toast-notification-container {
    position: fixed;
    bottom: 20px;
    right: 130px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: auto;
}

.toast-notification {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    font-family: 'Poppins', sans-serif;
    border-left: 4px solid #4CAF50;
    min-width: 300px;
    max-width: 400px;
    word-wrap: break-word;
}

.toast-notification.error {
    border-left-color: #E63946;
}

.toast-notification.warning {
    border-left-color: #FFA500;
}

.toast-notification.info {
    border-left-color: #2196F3;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon.success {
    color: #4CAF50;
}

.toast-icon.error {
    color: #E63946;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.toast-message {
    font-size: 13px;
    color: #666666;
    line-height: 1.4;
    word-wrap: break-word;
}

.toast-close {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: #999999;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #333333;
}

/* TABLET I MNIEJSZE */
@media (max-width: 1024px) {
    .toast-notification-container {
        right: 15px;
        bottom: 15px;
        max-width: 350px;
    }
    
    .toast-notification {
        min-width: 280px;
        max-width: 350px;
    }
}

/* MOBILE */
@media (max-width: 767px) {
    .toast-notification-container {
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-width: none;
        width: auto;
    }
    
    .toast-notification {
        min-width: auto;
        max-width: none;
        width: 100%;
        padding: 12px 15px;
    }
    
    .toast-title {
        font-size: 13px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}

/* BARDZO MAŁE EKRANY */
@media (max-width: 480px) {
    .toast-notification-container {
        right: 5px;
        left: 5px;
        bottom: 5px;
    }
    
    .toast-notification {
        padding: 10px 12px;
    }
}
/* ==========================================
   10. QUICK VIEW POPUP
   ========================================== */

.quickview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.quickview-overlay.active {
    display: flex;
}

.quickview-modal {
    background: #FFFFFF;
    border-radius: 15px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Close button */
.quickview-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    padding:0 !important;
}

.quickview-close:hover {
    background: #FDA635;
    color: #FFFFFF;
}

/* Content layout */
.quickview-popup-content {
    display: flex;
    gap: 30px;
    padding: 40px;
}

/* ==========================================
   11. QUICK VIEW - GALERIA
   ========================================== */

.quickview-gallery {
    flex: 0 0 400px;
}

.quickview-main-image {
    width: 400px;
    height: 400px;
    margin-bottom: 15px;
}

.quickview-image-container {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px dashed #E5E5E5;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.quickview-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.quickview-thumbnail {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quickview-thumbnail:hover,
.quickview-thumbnail.active {
    border-color: #FDA635;
}

/* ==========================================
   12. QUICK VIEW - INFO
   ========================================== */
.quickview-info {
    flex: 1;
}

.quickview-title {
    font-size: 24px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #333333;
    margin: 0 0 15px 0;
}

.quickview-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.quickview-price .price-current {
    font-size: 24px;
}

.quickview-price .price-regular {
    font-size: 18px;
}

.quickview-description {
    color: #666666;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    margin-bottom: 20px;
}

.quickview-attributes {
    margin-bottom: 25px;
}

.quickview-attributes h4 {
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #333333;
    margin: 0 0 10px 0;
}

.quickview-attributes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quickview-attributes li {
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    color: #666666;
    margin-bottom: 8px;
}

/* ✅ NOWE STYLE - TYLKO JEDEN PRZYCISK */
.quickview-actions {
    margin-top: 25px;
}

.quickview-view-product {
    display: block;
    width: 100%;
    height: 45px;
    background: linear-gradient(135deg, #fda635 0%, #ff8c42 100%);
    border: none;
    border-radius: 50px;
    color: #FFFFFF !important;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    text-align: center;
    line-height: 45px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(253, 166, 53, 0.3);
}

.quickview-view-product:hover {
    background: linear-gradient(135deg, #ff8c42 0%, #fda635 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(253, 166, 53, 0.4);
}


/* ==========================================
   13. RESPONSIVE
   ========================================== */

/* Tablet */
@media (max-width: 1024px) {
    .quickview-popup-content {
        flex-direction: column;
        padding: 30px;
    }
    
    .quickview-gallery {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .quickview-main-image {
        width: 100%;
        max-width: 400px;
        height: 400px;
        margin: 0 auto 15px;
    }
    
    .toast-notification-container {
        right: 15px;
        bottom: 15px;
        max-width: 320px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .custom-product-card {
        max-width: 180px;
    }
    
    .product-image-container {
        width: 180px;
        height: 180px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .price-current,
    .price-regular {
        font-size: 14px;
    }
    
    .quickview-popup-content {
        padding: 20px;
    }
    
    .quickview-main-image {
        height: 300px;
    }
    
    .quickview-title {
        font-size: 20px;
    }
    
    .layout-horizontal {
        flex-direction: column;
        max-width: 180px;
    }
    
    .toast-notification-container {
        right: 10px;
        bottom: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast-notification {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .custom-product-card {
        max-width: 160px;
    }
    
    .product-image-container {
        width: 160px;
        height: 160px;
    }
    
    .quickview-main-image {
        height: 250px;
    }
}

/* ==========================================
   COMPARE MODAL - WYŚRODKOWANY (FIX)
   ========================================== */
.compare-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.compare-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.compare-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #FFFFFF;
    border-radius: 15px;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    max-height: 900px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.compare-modal-overlay.active .compare-modal {
    transform: translate(-50%, -50%) scale(1);
}

.compare-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.compare-modal-close:hover {
    background: #FDA635;
    transform: rotate(90deg);
}

.compare-modal iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .compare-modal {
        width: 95%;
        height: 95vh;
        border-radius: 10px;
    }
}