/* Podstawowy wygląd pola wyszukiwania */
.drpixel-ean-search-wrapper {
    max-width: 480px;
    margin: 1em auto;
    font-family: inherit;
}

.drpixel-ean-search-form {
    display: flex;
    gap: 0.5em;
    align-items: stretch;
}

.drpixel-ean-search-input {
    flex: 1 1 auto;
    padding: 0.5em 0.75em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.drpixel-ean-search-submit {
    padding: 0.5em 0.9em;
    border-radius: 4px;
    border: 1px solid #007cba;
    background: #007cba;
    color: #fff;
    cursor: pointer;
}

.drpixel-ean-search-submit:hover {
    background: #0066a1;
    border-color: #0066a1;
}

/* Przycisk skanera – domyślnie ukryty (tylko mobile) */
.drpixel-ean-search-scan-btn {
    display: none;
    align-items: center;
    gap: 0.25em;
    padding: 0.5em 0.7em;
    border-radius: 4px;
    border: 1px solid #333;
    background: #333;
    color: #fff;
    cursor: pointer;
}

/* Ikonka aparatu z samego CSS */
.drpixel-ean-search-scan-icon {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    border: 2px solid currentColor;
    position: relative;
    display: inline-block;
    box-sizing: border-box;
}

.drpixel-ean-search-scan-icon::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 3px;
    width: 8px;
    height: 4px;
    border-radius: 1px 1px 0 0;
    border: 2px solid currentColor;
    border-bottom: 0;
    box-sizing: border-box;
}

.drpixel-ean-search-scan-icon::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 2px solid currentColor;
    box-sizing: border-box;
}

/* Mobile-only */
@media (max-width: 768px) {
    .drpixel-ean-search-form {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.5em;
    }

    .drpixel-ean-search-input {
        grid-column: 1 / span 2;
    }

    .drpixel-ean-search-submit {
        grid-column: 1;
    }

    .drpixel-ean-search-scan-btn {
        display: inline-flex;
        grid-column: 2;
        justify-content: center;
    }
}

/* Overlay skanera */
.drpixel-ean-scanner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drpixel-ean-scanner-inner {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #111;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.drpixel-ean-scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6em 0.9em;
    background: #222;
}

.drpixel-ean-scanner-title {
    font-weight: 600;
}

.drpixel-ean-scanner-close {
    border: 0;
    background: none;
    color: #fff;
    font-size: 1.3em;
    cursor: pointer;
}

.drpixel-ean-scanner-video-wrap {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.drpixel-ean-scanner-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drpixel-ean-scanner-target {
    position: absolute;
    inset: 15% 10%;
    border: 2px solid rgba(0, 255, 0, 0.7);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 0 12px rgba(0,255,0,0.7);
    pointer-events: none;
}

.drpixel-ean-scanner-status {
    padding: 0.6em 0.9em;
    font-size: 0.9em;
    background: #111;
}

.drpixel-ean-scanner-footer {
    padding: 0.8em 0.9em 1em;
    background: #111;
    text-align: right;
}

.drpixel-ean-scanner-close-main {
    border: 1px solid #666;
    background: #222;
    color: #fff;
    padding: 0.4em 0.9em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.drpixel-ean-scanner-close-main:hover {
    background: #333;
    border-color: #888;
}

.drpixel-ean-scanner-hint {
    padding: 0.4em 0.9em 0;
    font-size: 0.8em;
    color: #ccc;
    background: #111;
    margin: 0;
}
