/*
 * Free Gift notification - Hyvä Theme styles.
 *
 * Most styling is achieved via Tailwind utility classes embedded in the
 * notification template. This stylesheet provides sensible fallback styles
 * (e.g. for SVG sizing and the close button) and a few custom properties
 * that can be overridden by a merchant's theme.
 */

[x-cloak] {
    display: none !important;
}

.free-gift-notification-wrapper-hyva {
    --free-gift-notification-bg: #f8f9fa;
    --free-gift-notification-border: #e5e5e5;
    --free-gift-notification-color: #006400;
    --free-gift-notification-radius: 0.375rem;
}

.free-gift-notification {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    background-color: var(--free-gift-notification-bg);
    border: 1px solid var(--free-gift-notification-border);
    border-radius: var(--free-gift-notification-radius);
    color: var(--free-gift-notification-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    font-size: 1rem;
    line-height: 1.4;
    width: 100%;
}

.free-gift-notification svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--free-gift-notification-color);
    flex: 0 0 auto;
}

.free-gift-notification p {
    margin: 0;
    flex: 1 1 auto;
}

.free-gift-notification-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.free-gift-notification-close:hover,
.free-gift-notification-close:focus {
    opacity: 0.7;
    outline: none;
}

@media (min-width: 1440px) {
    .free-gift-notification {
        width: 80%;
        min-width: 300px;
        margin: 0 auto 1.25rem;
    }

    .minicart-wrapper .free-gift-notification {
        width: 100%;
        margin-top: 1.25rem;
    }
}

/* ------------------------------------------------------------------ */
/* Express Free Gift popup                                             */
/* ------------------------------------------------------------------ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.free-gift-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1rem;
}

.free-gift-popup-dialog {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 768px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.free-gift-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.free-gift-popup-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.free-gift-popup-close {
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
    padding: 0.25rem 0.5rem;
}

.free-gift-popup-close:hover,
.free-gift-popup-close:focus {
    color: #000;
    outline: none;
}

.free-gift-popup-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.free-gift-popup-body .note {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #666;
}

.free-gift-popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e5e5;
}

.free-gift-popup-footer .action {
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.95rem;
    line-height: 1.2;
}

.free-gift-popup-footer .action.primary {
    background: #007cba;
    color: #fff;
}

.free-gift-popup-footer .action.primary:hover {
    background: #006ba0;
}

.free-gift-popup-footer .action.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.free-gift-popup-footer .action.secondary {
    background: transparent;
    color: #333;
    border-color: #ccc;
}

.free-gift-popup-footer .action.secondary:hover {
    background: #f5f5f5;
}

.free-gift-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.free-gift-option {
    border: 2px solid #e5e5e5;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.free-gift-option:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
}

.free-gift-option.selected {
    border-color: #007cba;
    background-color: #f8f9fa;
}

.free-gift-option label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    margin: 0;
}

.free-gift-option img {
    max-width: 80px;
    height: auto;
    flex: 0 0 auto;
    border-radius: 0.25rem;
}

.free-gift-option-content {
    flex: 1 1 auto;
    min-width: 0;
}

.free-gift-option-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.free-gift-option-content p {
    margin: 0;
    font-size: 0.875rem;
    color: #666;
}

.free-gift-option-price {
    color: #000;
    visibility: hidden;
    margin-left: auto;
}

.free-gift-option.selected .free-gift-option-price {
    visibility: visible;
    font-weight: 700;
}

.free-gift-option-fake-radio {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 1px solid #000;
    position: relative;
}

.free-gift-option-fake-radio.selected::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 4px solid #000;
    border-radius: 50%;
}

.configurable-selection-summary {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #e8f5e8;
    border-radius: 0.25rem;
    border-left: 3px solid #4caf50;
    color: #2e7d32;
    font-size: 0.875rem;
}

.free-gift-configurable-options-content {
    padding: 0;
}

.free-gift-configurable-options-content .product-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e5e5;
}

.free-gift-configurable-options-content .product-info img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.25rem;
    flex: 0 0 auto;
}

.free-gift-configurable-options-content .product-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: #333;
}

.free-gift-configurable-options-content .product-info p {
    margin: 0;
    color: #666;
}

.configurable-option-group {
    margin-bottom: 1.5rem;
}

.configurable-option-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1rem;
}

.configurable-option-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.configurable-option-value {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 2px solid #e5e5e5;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    background: #fff;
    transition: all 0.2s ease;
    min-width: 60px;
    justify-content: center;
}

.configurable-option-value:hover {
    border-color: #007cba;
    background-color: #f8f9fa;
}

.configurable-option-value.selected {
    border-color: #007cba;
    background-color: #007cba;
    color: #fff;
}

.configurable-option-value input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.configurable-option-value span {
    line-height: 1.2;
}

@media (max-width: 768px) {
    .free-gift-popup-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .free-gift-popup-dialog {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 0.5rem 0.5rem 0 0;
    }

    .free-gift-configurable-options-content .product-info img {
        width: 80px;
        height: 80px;
    }

    .configurable-option-values {
        flex-direction: column;
    }

    .configurable-option-value {
        text-align: left;
        min-width: 0;
        justify-content: flex-start;
    }
}
