/**
 * Floating Product Box Styles
 * Pływający box produktu WooCommerce przy Hero
 * 
 * @package NowyTydzien
 */

/* ============================================
   FLOATING PRODUCT BOX
   ============================================ */

.floating-product-box {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 200px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: visible;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.3s ease;
    z-index: 100;
    border: 2px solid transparent;
}

.floating-product-box.is-dragging {
    cursor: grabbing;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transition: none;
}

.floating-product-box.is-hidden {
    display: none;
}

.floating-product-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(225, 27, 34, 0.25);
    border-color: var(--color-primary);
}

body.dark-mode .floating-product-box {
    background: var(--bg-secondary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .floating-product-box:hover {
    box-shadow: 0 20px 50px rgba(225, 27, 34, 0.3);
}

/* Link wewnętrzny */
.floating-product-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Przycisk zamknięcia */
.floating-product-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
}

.floating-product-close:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--text-light);
    transform: scale(1.1);
}

body.dark-mode .floating-product-close {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* Uchwyt do przeciągania */
.floating-product-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: var(--bg-secondary);
    cursor: grab;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.floating-product-drag-handle:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.floating-product-drag-handle:active {
    cursor: grabbing;
}

body.dark-mode .floating-product-drag-handle {
    background: rgba(255, 255, 255, 0.05);
}

/* Badge */
.floating-product-badge {
    background: var(--color-primary);
    color: var(--text-light);
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    text-align: center;
    transition: background 0.3s ease;
}

.floating-product-box:hover .floating-product-badge {
    background: var(--color-primary-dark, #c41820);
}

/* Obrazek produktu */
.floating-product-image {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #f5f5f5;
}

body.dark-mode .floating-product-image {
    background: #1a1a2e;
}

.floating-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info produktu */
.floating-product-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    transition: background 0.3s ease;
}

.floating-product-box:hover .floating-product-info {
    background: rgba(225, 27, 34, 0.03);
}

body.dark-mode .floating-product-box:hover .floating-product-info {
    background: rgba(225, 27, 34, 0.1);
}

.floating-product-price {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    transition: transform 0.3s ease, color 0.3s ease;
}

.floating-product-box:hover .floating-product-price {
    transform: scale(1.1);
    color: var(--color-primary-dark, #c41820);
}

.floating-product-price del {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: normal;
}

.floating-product-cta {
    display: block;
    background: var(--color-primary);
    color: var(--text-light);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.floating-product-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.floating-product-box:hover .floating-product-cta {
    background: var(--color-primary-dark, #c41820);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(225, 27, 34, 0.5);
}

.floating-product-box:hover .floating-product-cta::before {
    left: 100%;
}

/* ============================================
   RESPONSIVE - Floating box
   ============================================ */

/* Szerokie ekrany */
@media (min-width: 1400px) {
    .floating-product-box {
        right: 30px;
        width: 210px;
    }
}

/* Średnie desktop */
@media (max-width: 1399px) and (min-width: 1200px) {
    .floating-product-box {
        right: 20px;
        width: 190px;
    }
}

/* Tablet - miniaturka w prawym dolnym rogu */
@media (max-width: 1199px) and (min-width: 768px) {
    .floating-product-box {
        top: auto;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 16px);
        right: 20px;
        width: 140px;
        border-radius: var(--radius-md);
    }
    
    .floating-product-drag-handle {
        padding: 4px;
    }
    
    .floating-product-drag-handle svg {
        width: 12px;
        height: 12px;
    }
    
    .floating-product-close {
        width: 20px;
        height: 20px;
        top: -8px;
        right: -8px;
    }
    
    .floating-product-close svg {
        width: 10px;
        height: 10px;
    }
    
    .floating-product-badge {
        font-size: 9px;
        padding: 5px 8px;
    }
    
    .floating-product-image {
        aspect-ratio: 3/4;
    }
    
    .floating-product-info {
        padding: 10px;
        gap: 5px;
    }
    
    .floating-product-price {
        font-size: var(--font-size-sm);
    }
    
    .floating-product-cta {
        font-size: 10px;
        padding: 8px 10px;
    }
}

/* Mobile - ukryty */
@media (max-width: 767px) {
    .floating-product-box {
        display: none;
    }
}
