/**
 * PrestaEANSearch CSS
 * Style dla przycisku skanera i modala
 */

/* Przycisk skanera */
#ean-scanner-btn {
    display: inline-block;
    margin-right: 65px;
    cursor: pointer;
}

.nweansearch{
        display: flex;
    gap: 10px;
    align-items: center;
}

/* Modal skanera */
.ean-scanner-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.ean-scanner-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Zawartość modala */
.ean-scanner-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.ean-scanner-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.ean-scanner-close-btn {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.ean-scanner-close-btn:hover {
    color: #333;
}

/* Body modala */
.ean-scanner-body {
    padding: 20px;
}

/* Czytnik skanera - Html5QrcodeScanner tworzy UI */
.ean-scanner-reader {
    width: 100%;
    min-height: 300px;
    margin-bottom: 20px;
    position: relative;
}

#ean-scanner-reader {
    width: 100% !important;
}

#ean-scanner-reader video {
    max-width: 100% !important;
    height: auto !important;
}

/* Ukryj przyciski generowane przez Html5QrcodeScanner */
#ean-scanner-reader__dashboard_section,
#ean-scanner-reader__dashboard_section_csr,
#ean-scanner-reader button {
    display: none !important;
}

/* Status */
.ean-scanner-status {
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    margin-bottom: 15px;
}

.ean-scanner-status.info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.ean-scanner-status.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.ean-scanner-status.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Wyniki - produkty */
.ean-scanner-result {
    margin-top: 20px;
}

.ean-scanner-products {
    margin-bottom: 20px;
}

.ean-scanner-product {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.ean-scanner-product img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: 5px;
}

.ean-scanner-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ean-scanner-product-info h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.ean-scanner-product-info p {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.ean-scanner-product-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

.ean-scanner-product-details .price {
    font-size: 20px;
    font-weight: 700;
    color: #2fb5d2;
}

.ean-scanner-product-details .ean {
    color: #666;
    padding: 4px 8px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    font-family: monospace;
}

.ean-scanner-product-details .available {
    color: #2e7d32;
    padding: 4px 8px;
    background: #e8f5e9;
    border-radius: 4px;
    font-weight: 600;
}

.ean-scanner-product-details .unavailable {
    color: #c62828;
    padding: 4px 8px;
    background: #ffebee;
    border-radius: 4px;
    font-weight: 600;
}

/* Przyciski */
.ean-scanner-result .btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.ean-scanner-result .btn-primary {
    background-color: #2fb5d2;
    color: #fff;
}

.ean-scanner-result .btn-primary:hover {
    background-color: #2596ad;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.ean-scanner-result .btn-secondary {
    background-color: #757575;
    color: #fff;
    margin-top: 10px;
}

.ean-scanner-result .btn-secondary:hover {
    background-color: #616161;
}

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

    .ean-scanner-product {
        flex-direction: column;
        text-align: center;
    }

    .ean-scanner-product img {
        width: 100%;
        max-width: 200px;
        height: auto;
        margin: 0 auto;
    }

    .ean-scanner-product-details {
        justify-content: center;
    }

    #ean-scanner-btn {
        padding: 8px;
        margin-left: 5px;
    }

    #ean-scanner-btn span {
        display: none;
    }

    #ean-scanner-btn svg {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .ean-scanner-header h3 {
        font-size: 18px;
    }

    .ean-scanner-body {
        padding: 15px;
    }

    .ean-scanner-reader {
        min-height: 250px;
    }
}

/* Accessibility */
.ean-scanner-modal:focus-within .ean-scanner-content {
    outline: 2px solid #2fb5d2;
    outline-offset: 2px;
}

/* Loading animation */
.ean-scanner-reader.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2fb5d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.search-actions{
        position: absolute;
    top: 0;
    right: 0;
    height: 40px;
    display: flex;
}

.bttsextra{
    padding-right: 86px; 
}