/**
 * Allegro Overlay Styles
 * Style dla nakładki konfiguratora Allegro
 * Wersja: 1.0.0
 */

/* ==================== ZMIENNE ====================  */

:root {
    --allegro-orange: #ff5a00;
    --allegro-orange-dark: #e65000;
    --allegro-orange-light: #ff8c00;
    --allegro-bg: #fff5f0;
    --allegro-success: #28a745;
    --allegro-text: #333333;
    --allegro-text-light: #666666;
    --allegro-border: #e0e0e0;
    --allegro-shadow: 0 4px 20px rgba(255, 90, 0, 0.2);
}

/* ==================== UKRYJ WORDPRESS BRANDING ====================  */

.site-header,
.site-footer,
#masthead,
#colophon,
.wp-site-blocks > header,
.wp-site-blocks > footer,
header.entry-header,
footer.entry-footer {
    display: none !important;
}

/* ==================== PRZYCISK ZAKUPU ALLEGRO ====================  */

.allegro-buy-btn {
    background: linear-gradient(135deg, var(--allegro-orange) 0%, var(--allegro-orange-light) 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    padding: 15px 30px !important;
    border-radius: 10px !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(255, 90, 0, 0.3) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.allegro-buy-btn:hover {
    background: linear-gradient(135deg, var(--allegro-orange-dark) 0%, var(--allegro-orange) 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 90, 0, 0.4) !important;
}

.allegro-buy-btn:active {
    transform: translateY(0) !important;
}

.allegro-btn-icon {
    font-size: 1.3rem;
}

/* ==================== CENA ALLEGRO ====================  */

.allegro-price-main {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--allegro-orange);
    display: block;
}

.allegro-price-info {
    display: block;
    font-size: 0.9rem;
    color: var(--allegro-text-light);
    margin-top: 5px;
    font-weight: 400;
}

.allegro-rounding-info {
    background: var(--allegro-bg);
    border-left: 3px solid var(--allegro-orange);
    padding: 10px 15px;
    margin-top: 15px;
    border-radius: 0 8px 8px 0;
}

.allegro-rounding-info small {
    color: var(--allegro-text-light);
}

/* ==================== ZAZNACZONY PRODUKT ====================  */

.allegro-selected {
    border: 3px solid var(--allegro-orange) !important;
    box-shadow: 0 0 15px rgba(255, 90, 0, 0.4) !important;
    position: relative;
}

.allegro-selected::after {
    content: 'Allegro';
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--allegro-orange);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* ==================== POPUP ALLEGRO ====================  */

.allegro-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    padding: 20px;
    box-sizing: border-box;
}

.allegro-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.allegro-popup-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: allegroPopupIn 0.3s ease;
}

@keyframes allegroPopupIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.allegro-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.allegro-popup-close:hover {
    background: var(--allegro-orange);
    color: white;
}

/* Popup Header */
.allegro-popup-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.allegro-logo-container {
    margin-bottom: 15px;
}

.allegro-logo {
    height: 36px;
}

.allegro-popup-header h2 {
    color: var(--allegro-text);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Popup Body */
.allegro-popup-body {
    /* empty */
}

/* Instrukcja */
.allegro-instruction {
    background: linear-gradient(135deg, #fff8f5 0%, #fff0eb 100%);
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 90, 0, 0.1);
}

.allegro-instruction h3 {
    margin: 0 0 15px 0;
    color: var(--allegro-text);
    font-size: 1rem;
    font-weight: 600;
}

.allegro-instruction ol {
    padding-left: 20px;
    margin: 0;
    counter-reset: step-counter;
    list-style: none;
}

.allegro-instruction li {
    margin-bottom: 18px;
    line-height: 1.5;
    position: relative;
    padding-left: 35px;
    counter-increment: step-counter;
}

.allegro-instruction li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--allegro-orange);
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.allegro-instruction li:last-child {
    margin-bottom: 0;
}

.allegro-instruction li strong {
    color: var(--allegro-text);
    display: block;
    margin-bottom: 8px;
}

/* Pole kopiowania session_id */
.allegro-session-copy {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.allegro-session-copy input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--allegro-border);
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--allegro-text);
    background: white;
    transition: border-color 0.2s;
}

.allegro-session-copy input:focus {
    outline: none;
    border-color: var(--allegro-orange);
}

.allegro-session-copy button {
    padding: 12px 18px;
    background: var(--allegro-orange);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.allegro-session-copy button:hover {
    background: var(--allegro-orange-dark);
}

.allegro-session-copy button.copied {
    background: var(--allegro-success);
}

.copy-icon {
    font-size: 1.1rem;
}

/* Podsumowanie */
.allegro-summary {
    background: linear-gradient(135deg, #fff8f5 0%, #ffe8dc 100%);
    border: 2px solid var(--allegro-orange);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.allegro-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 90, 0, 0.15);
}

.allegro-summary-row:last-child {
    border-bottom: none;
}

.allegro-summary-row span:first-child {
    color: var(--allegro-text-light);
}

.allegro-summary-row strong {
    color: var(--allegro-text);
    font-size: 1.1rem;
}

.allegro-summary-row.total {
    border-top: 2px solid var(--allegro-orange);
    border-bottom: none;
    padding-top: 15px;
    margin-top: 5px;
}

.allegro-summary-row.total span:first-child {
    font-weight: 600;
    color: var(--allegro-text);
}

.allegro-summary-row.total strong {
    font-size: 1.4rem;
    color: var(--allegro-orange);
}

/* Przycisk do aukcji */
.allegro-buy-button {
    display: block;
    width: 100%;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--allegro-orange) 0%, var(--allegro-orange-light) 100%);
    color: white !important;
    text-decoration: none !important;
    text-align: center;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 90, 0, 0.3);
}

.allegro-buy-button:hover {
    background: linear-gradient(135deg, var(--allegro-orange-dark) 0%, var(--allegro-orange) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 90, 0, 0.4);
    color: white !important;
}

/* Notatka */
.allegro-note {
    text-align: center;
    color: var(--allegro-text-light);
    font-size: 0.85rem;
    margin: 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    line-height: 1.5;
}

.allegro-note .info-icon {
    margin-right: 5px;
}

/* ==================== RESPONSYWNOŚĆ ====================  */

@media (max-width: 600px) {
    .allegro-popup {
        padding: 10px;
    }

    .allegro-popup-content {
        padding: 25px 20px;
        border-radius: 15px;
    }

    .allegro-popup-header h2 {
        font-size: 1.3rem;
    }

    .allegro-instruction {
        padding: 15px;
    }

    .allegro-instruction li {
        padding-left: 30px;
    }

    .allegro-session-copy {
        flex-direction: column;
    }

    .allegro-session-copy button {
        width: 100%;
        justify-content: center;
    }

    .allegro-summary-row.total strong {
        font-size: 1.2rem;
    }

    .allegro-buy-button {
        font-size: 1rem;
        padding: 15px;
    }
}

/* ==================== UKRYCIE ELEMENTÓW DLA ALLEGRO ====================  */

/* Ukryj przycisk weryfikacji */
#sendToVerifBtnSummary,
#sendToEmailBtn,
#summaryGrossPrice,
.save-email-section,
#summaryNetPrice,
.verification-section,
.contact-mode-card {
    display: none !important;
}

/* Karta kontaktu */
.mode-card[onclick*="contact"],
[data-mode="contact"] {
    display: none !important;
}

/* ==================== NOWY POPUP v1.2.0 - INPUT LOGIN/EMAIL ====================  */

.allegro-user-input {
    background: linear-gradient(135deg, #fff8f5 0%, #fff0eb 100%);
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 90, 0, 0.1);
}

.allegro-user-input h3 {
    margin: 0 0 8px 0;
    color: var(--allegro-text);
    font-size: 1.1rem;
    font-weight: 600;
}

.allegro-user-input-desc {
    margin: 0 0 20px 0;
    color: var(--allegro-text-light);
    font-size: 0.9rem;
}

/* Radio selector */
.allegro-input-type-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.allegro-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    background: white;
    border: 2px solid var(--allegro-border);
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.allegro-radio-label:hover {
    border-color: var(--allegro-orange);
}

.allegro-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--allegro-orange);
    cursor: pointer;
}

.allegro-radio-label input[type="radio"]:checked + span {
    color: var(--allegro-orange);
    font-weight: 600;
}

.allegro-radio-label:has(input:checked) {
    border-color: var(--allegro-orange);
    background: rgba(255, 90, 0, 0.05);
}

/* Input wrapper */
.allegro-input-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.allegro-input-wrapper input {
    width: 100%;
    padding: 15px 50px 15px 18px;
    border: 2px solid var(--allegro-border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--allegro-text);
    background: white;
    transition: all 0.2s;
    box-sizing: border-box;
}

.allegro-input-wrapper input:focus {
    outline: none;
    border-color: var(--allegro-orange);
    box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.1);
}

.allegro-input-wrapper input.valid {
    border-color: var(--allegro-success);
}

.allegro-input-wrapper input.invalid {
    border-color: #dc3545;
}

.allegro-input-wrapper input::placeholder {
    color: #aaa;
}

.allegro-input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    pointer-events: none;
}

/* Hint pod inputem */
.allegro-input-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--allegro-text-light);
    font-style: italic;
}

/* Błąd walidacji */
.allegro-input-error {
    background: #fff5f5;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 12px 15px;
    border-radius: 8px;
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    text-align: center;
}

/* Disabled button */
.allegro-buy-button:disabled,
.allegro-buy-button[disabled] {
    background: #ccc !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7;
}

.allegro-buy-button:disabled:hover {
    background: #ccc !important;
    transform: none !important;
}

/* Button jako button zamiast link */
button.allegro-buy-button {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Highlight quantity */
.highlight-quantity {
    background: var(--allegro-orange);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}

/* Price info box */
.allegro-price-info-box {
    margin-top: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%);
    border-left: 4px solid var(--allegro-orange);
    border-radius: 0 8px 8px 0;
}

.allegro-price-rounded {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.allegro-price-rounded strong {
    color: var(--allegro-orange);
    font-size: 1.1rem;
}

.allegro-price-rounded span {
    color: var(--allegro-text-light);
    font-size: 0.85rem;
}

/* Warning */
.allegro-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* ==================== RESPONSYWNOŚĆ v1.2.0 ====================  */

@media (max-width: 600px) {
    .allegro-input-type-selector {
        flex-direction: column;
        gap: 10px;
    }

    .allegro-radio-label {
        justify-content: flex-start;
    }

    .allegro-user-input {
        padding: 15px;
    }

    .allegro-user-input h3 {
        font-size: 1rem;
    }
}
