/**
 * ExtraBox Panel Styles
 * Lokalizacja: modules/ds_engraver/views/css/extrabox-panel.css
 */

/* Panel overlay */
.extrabox-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.extrabox-panel.open {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.extrabox-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* Panel content */
.extrabox-panel-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.extrabox-panel.open .extrabox-panel-content {
    transform: translateY(0);
}

/* Header */
.extrabox-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.extrabox-panel-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.extrabox-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.2s;
}

.extrabox-panel-close:hover {
    color: #333;
}

.extrabox-panel-close .material-icons {
    font-size: 24px;
}

/* Body */
.extrabox-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

/* List of boxes */
.extrabox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.extrabox-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.extrabox-item:hover {
    border-color: #2fb5d2;
    box-shadow: 0 4px 12px rgba(47, 181, 210, 0.1);
}

.extrabox-item.selected {
    border-color: #2fb5d2;
    background: #f0f9fb;
}

.extrabox-item-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 12px;
    background: #f5f5f5;
}

.extrabox-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.extrabox-item-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: #333;
}

.extrabox-item-info .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2fb5d2;
    margin: 0;
}

.extrabox-item-check {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #2fb5d2;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.extrabox-item.selected .extrabox-item-check {
    opacity: 1;
    transform: scale(1);
}

.extrabox-item-check .material-icons {
    font-size: 28px;
}

/* Footer */
.extrabox-panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
}

.extrabox-panel-footer .btn {
    min-width: 120px;
}

/* Info w koszyku */
.extrabox-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-top: 10px;
    background: #f0f9fb;
    border-radius: 4px;
    font-size: 0.9rem;
}

.extrabox-info .material-icons {
    color: #2fb5d2;
    font-size: 20px;
}

.extrabox-info span {
    flex: 1;
    color: #333;
}

.extrabox-info .btn-link {
    color: #d32f2f;
    text-decoration: none;
    padding: 0;
    font-size: 0.85rem;
}

.extrabox-info .btn-link:hover {
    text-decoration: underline;
}

/* Przycisk dodawania pudełka w koszyku */
.extrabox-trigger {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.extrabox-trigger .material-icons {
    font-size: 18px;
}

/* Ukryj produkty extra box */
.cart-item[data-is-extra-box="1"] {
    display: none !important;
}

/* Body class gdy panel otwarty */
body.extrabox-panel-open {
    overflow: hidden;
}

/* Responsywność */
@media (max-width: 768px) {
    .extrabox-panel-content {
        width: 95%;
        max-height: 95vh;
    }

    .extrabox-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .extrabox-panel-header,
    .extrabox-panel-body,
    .extrabox-panel-footer {
        padding: 15px;
    }

    .extrabox-panel-header h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .extrabox-list {
        grid-template-columns: 1fr;
    }

    .extrabox-panel-footer {
        flex-direction: column-reverse;
    }

    .extrabox-panel-footer .btn {
        width: 100%;
    }
}

/* ========================================
   PRODUKTY EXTRA - WYŚWIETLANIE W KOSZYKU
   ======================================== */

/* Produkt extra - wcięcie i ikona plus */
.product-extra-box {
    position: relative;
    padding-left: 40px !important;
    background: #f9f9f9;
    border-left: 3px solid #2fb5d2;
    margin-top: 10px;
}

/* Ikona plus po lewej stronie */
.extra-box-indicator {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    z-index: 1;
}

.extra-box-indicator svg {
    display: block;
}

/* Info o ilości dla produktu extra (zamiast input) */
.extra-box-qty-info {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 8px 0;
    font-size: 14px;
}

/* Override - produkty extra są WIDOCZNE jako dodatki */
.cart-item[data-is-extra-box="1"],
.product-line-grid[data-is-extra-box="1"] {
    display: grid !important; /* lub block, w zależności od layoutu */
}

.extra-box-hidden {
    display: grid !important;
}

/* Responsywność - mobile */
@media (max-width: 768px) {
    .product-extra-box {
        padding-left: 30px !important;
    }

    .extra-box-indicator {
        left: 5px;
        width: 18px;
        height: 18px;
    }

    .extra-box-qty-info {
        font-size: 13px;
    }
}