/**
 * Frontend Styles for Breep FPD Character Pricing
 * Custom House Number Configurator
 */

/* Font Face Declarations */
@font-face {
    font-family: 'Arial Bold';
    src: url('/fonts/arialbd.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Berlin Sans';
    src: url('/fonts/BRLNSDB.TTF') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Broadway';
    src: url('/fonts/BROADW.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Showcard Gothic';
    src: url('/fonts/SHOWG.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Customize Button */
.breep-customize-button {
    display: inline-block;
    padding: 15px 30px;
    background: #2271b1;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 20px 0;
    transition: background 0.3s ease;
}

.breep-customize-button:hover {
    background: #135e96;
}

.breep-customize-button:active {
    background: #0a4b78;
}

/* Configurator Container */
.breep-configurator-container {
    display: none;
    margin: 30px 0;
    padding: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.breep-configurator-container.active {
    display: block;
}

/* Two Column Layout */
.breep-configurator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

/* Preview Section (Left) */
.breep-preview-section {
    background: #f5f5f5;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #ddd;
}

.breep-preview-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
    text-align: center;
}

.breep-canvas-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #fff;
    border: none;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

#breep-preview-canvas {
    display: block;
    width: 100%;
    height: auto;
}

#breep-preview-canvas.breep-dragging {
    cursor: grabbing;
}

.breep-background-selector {
    margin-top: 10px;
}

.breep-background-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.breep-background-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.breep-background-thumb {
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 3px;
    width: 96px;
    min-width: 96px;
    cursor: pointer;
    background: #fff;
    transition: all .2s ease;
}

.breep-background-thumb img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.breep-background-thumb span {
    display: block;
    font-size: 11px;
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breep-background-thumb:hover {
    border-color: #2271b1;
}

.breep-background-thumb.active {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,.18);
}

.breep-position-reset-wrap {
    margin-top: 8px;
    text-align: right;
}

.breep-reset-position {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    font-size: 12px;
    padding: 5px 8px;
    cursor: pointer;
}

.breep-reset-position:hover {
    border-color: #2271b1;
    color: #2271b1;
}

/* Hide original product images ONLY on mobile mode (we re-use the gallery column on desktop) */
body.breep-configurator-mode-mobile .product .woocommerce-product-gallery,
body.breep-configurator-mode-mobile .product .woocommerce-product-gallery__image,
body.breep-configurator-mode-mobile .product .flex-control-thumbs,
body.breep-configurator-mode-mobile .product .images {
    display: none !important;
}

/* Hide default WooCommerce price */
.product .price {
    display: none !important;
}


/* Product wrapper for side-by-side layout */
.breep-product-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.breep-product-wrapper .breep-canvas-container {
    grid-column: 1;
}

.breep-product-wrapper .summary {
    grid-column: 2;
}

/* Inline configurator layout (ONLY used on mobile where preview is injected below the title) */
.breep-configurator-inline--mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    align-items: start;
    margin: 15px 0 10px;
}

.breep-configurator-inline--mobile > .breep-canvas-container,
.breep-configurator-inline--mobile > .breep-config-options {
    margin: 0 !important;
}

.breep-character-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.breep-mode-group {
    padding: 12px;
    border: 1px solid #d7e7f7;
    background: #f4f9ff;
    border-radius: 8px;
}

.breep-mode-toggle {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px 0 !important;
    font-weight: 600;
    cursor: pointer;
}

.breep-mode-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.breep-mode-help {
    margin: 0;
    color: #445;
    font-size: 12px;
    line-height: 1.4;
}

.breep-character-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.breep-mode-indicator {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #2271b1;
    background: #e9f3fc;
    border: 1px solid #bfd9f2;
    padding: 4px 8px;
    border-radius: 999px;
}

.breep-character-help {
    margin: 8px 0 10px;
    font-size: 12px;
    color: #666;
}

.breep-copy-all-button {
    width: 100%;
}

.breep-copy-all-button[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

.breep-character-tabs--disabled {
    opacity: .55;
}

.breep-character-tab {
    min-width: 42px;
    min-height: 40px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
}

.breep-character-tab.active {
    border-color: #2271b1;
    color: #2271b1;
    background: #f0f6fc;
}

.breep-character-tab:disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.breep-print-editor-wrap {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    position: relative;
}

#breep-print-editor-canvas {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-top: 8px;
}

.breep-print-editor-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.breep-print-library-tip {
    margin: 10px 0 0;
    font-size: 12px;
    color: #666;
}

.breep-print-delete-modal {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.breep-print-delete-modal.active {
    display: flex;
}

.breep-print-delete-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
}

.breep-print-delete-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    width: min(92%, 320px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    z-index: 1;
}

.breep-print-delete-modal__dialog p {
    margin: 0 0 12px;
    font-size: 14px;
    color: #1d2327;
}

.breep-print-delete-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.breep-print-toggle-modal {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 6;
}

.breep-print-toggle-modal.active {
    display: flex;
}

.breep-print-toggle-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
}

.breep-print-toggle-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    width: min(92%, 360px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    z-index: 1;
}

.breep-print-toggle-modal__dialog p {
    margin: 0 0 12px;
    font-size: 14px;
    color: #1d2327;
}

.breep-print-toggle-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.breep-price-status {
    margin-top: 8px;
    font-size: 12px;
    color: #8a6d3b;
}

/* Configuration Section (Right) */
.breep-config-section {
    padding: 30px;
    background: #fff;
    overflow-y: auto;
    max-height: 600px;
}

.breep-config-section h3 {
    margin: 0 0 25px 0;
    font-size: 20px;
    color: #333;
}

/* Option Groups */
.breep-option-group {
    margin-bottom: 25px;
}

.breep-option-group:last-child {
    margin-bottom: 0;
}

/* Prevent print section from affecting layout */
.breep-option-group:has(.breep-print-section) {
    margin-bottom: 25px !important;
}

.breep-option-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.breep-option-group input[type="text"],
.breep-option-group select {
    width: 100%;
    /*padding: 10px;*/
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    margin-bottom: 0;
}

.breep-option-group input[type="text"]:focus,
.breep-option-group select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    z-index: 20;
}

/* Fix for dropdown appearing behind other elements */
.breep-config-options {
    position: relative;
    z-index: 1;
}

.breep-option-group {
    position: relative;
    z-index: auto;
}

/* Font Buttons (replace font dropdown) */
.breep-font-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.breep-font-button {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.2;
    text-align: center;
    transition: all 0.2s ease;
}

.breep-font-button:hover {
    border-color: #2271b1;
    background: #f7fbff;
}

.breep-font-button.selected {
    border-color: #2271b1;
    background: #f0f6fc;
    color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.breep-font-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.25);
}

/* Color Options */
.breep-color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.breep-color-option {
}

.breep-color-option input[type="radio"] {
    display: none;
}

.breep-color-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-height: 44px;
    min-width: 44px;
    margin: 0;
}

.breep-color-option input[type="radio"]:checked + label {
    border-color: #2271b1;
    background: #f0f6fc;
    color: #2271b1;
}

.breep-color-option label:hover {
    border-color: #2271b1;
}

/* Print Upload Section */
.breep-print-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.breep-print-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.breep-print-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    margin-bottom: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.breep-print-toggle label {
    margin: 0;
    cursor: pointer;
    font-weight: 600;
}

.breep-print-options {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid #e0e0e0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease;
}

.breep-print-options.active {
    max-height: 1000px;
    opacity: 1;
    margin-top: 15px;
    padding-top: 15px;
}

.breep-print-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.breep-print-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.breep-print-tab:hover {
    color: #2271b1;
}

.breep-print-tab.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.breep-print-content {
    display: none;
}

.breep-print-content.active {
    display: block;
}

.breep-upload-area {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.breep-upload-area:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.breep-upload-area input[type="file"] {
    display: none;
}

.breep-upload-icon {
    font-size: 48px;
    color: #999;
    margin-bottom: 10px;
}

.breep-upload-text {
    color: #666;
    font-size: 14px;
}

.breep-print-preview {
    display: none;
    margin-top: 15px;
    text-align: center;
}

.breep-print-preview.active {
    display: block;
}

/* Print library grid */
.breep-print-item {
    transition: all 0.3s ease;
}

.breep-print-item:hover {
    border-color: #2196F3 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.breep-print-item.selected {
    border-color: #2196F3 !important;
    background-color: #e3f2fd;
}

.breep-print-preview img {
    max-width: 150px;
    max-height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.breep-print-library {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.breep-library-item {
    position: relative;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.breep-library-item:hover {
    border-color: #2271b1;
    transform: scale(1.05);
}

.breep-library-item.selected {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px #2271b1;
}

.breep-library-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Price Display */
.breep-price-display {
    background: #f0f6fc;
    padding: 20px;
    margin-top: 25px;
    border-radius: 4px;
    border: 2px solid #2271b1;
    text-align: center;
}

.breep-price-display .price-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.breep-price-display .price-amount {
    font-size: 48px;
    font-weight: bold;
    color: #2271b1;
    margin: 5px 0;
}

.breep-price-display .character-count {
    font-size: 13px;
    color: #999;
    margin-top: 5px;
}

.breep-price-breakdown {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #d0e4f5;
    font-size: 13px;
    text-align: left;
}

.breep-price-breakdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.breep-price-breakdown li {
    padding: 4px 0;
    color: #666;
}

.breep-price-breakdown li strong {
    color: #333;
}

/* Add to Cart Button */
.breep-add-to-cart-button {
    width: 100%;
    padding: 15px;
    background: #2271b1;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s ease;
}

.breep-add-to-cart-button:hover {
    background: #135e96;
}

.breep-add-to-cart-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading State */
.breep-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.breep-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #2271b1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: breep-spin 0.6s linear infinite;
}

@keyframes breep-spin {
    to { transform: rotate(360deg); }
}

/* Error Messages */
.breep-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
    border: 1px solid #f5c6cb;
}

/* Success Messages */
.breep-success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
    border: 1px solid #c3e6cb;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .breep-configurator-layout {
        grid-template-columns: 1fr;
    }
    
    .breep-preview-section {
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding: 20px;
    }
    
    .breep-config-section {
        padding: 20px;
        max-height: none;
    }
    
    .breep-canvas-container {
        max-width: 100%;
    }

    .breep-configurator-inline--mobile > .breep-canvas-container {
        position: sticky;
        top: var(--breep-mobile-sticky-top, 0px);
        z-index: 40;
        background: #fff;
        box-shadow: 0 4px 14px rgba(0,0,0,.12);
        border-radius: 6px;
        margin-bottom: 8px;
    }

    /* One-column layout for injected preview+options */
    .breep-configurator-inline--mobile {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .breep-color-options {
        flex-direction: row;
        gap: 12px;
    }

    .breep-font-buttons {
        grid-template-columns: 1fr;
    }

    .breep-color-option {
        /*flex: 1 1 calc(50% - 12px);*/
    }

    .breep-color-option label {
        width: 100%;
        justify-content: center;
        padding: 14px 12px;
    }
    
    .breep-print-library {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .breep-price-display .price-amount {
        font-size: 28px;
    }
}

@media screen and (max-width: 480px) {
    .breep-customize-button {
        width: 100%;
        text-align: center;
    }
    
    .breep-preview-section {
        padding: 15px;
    }
    
    .breep-config-section {
        padding: 15px;
    }
    
    .breep-print-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .breep-print-tab {
        text-align: center;
    }
}

/* Hidden Elements */
.breep-hidden {
    display: none !important;
}

/* Override Flatsome theme currency symbol sizing */
.breep-price-display .woocommerce-Price-currencySymbol {
    font-size: 1em !important;
    vertical-align: baseline !important;
}
