/* Hallmark Blinds Configurator - Frontend Styles */

.hbc-form-wrapper {
    max-width: 600px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.hbc-form {
    background-color: #f5f5f5;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.hbc-form-group {
    margin-bottom: 20px;
}

.hbc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.hbc-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333333;
    font-size: 14px;
}

.hbc-form-group label .required {
    color: #e74c3c;
    margin-left: 3px;
}

.hbc-form-group input[type="text"],
.hbc-form-group select,
.hbc-form-group input[type="number"],
.hbc-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.hbc-form-group input[type="text"]:focus,
.hbc-form-group select:focus,
.hbc-form-group input[type="number"]:focus,
.hbc-form-group textarea:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.hbc-form-group input[type="text"]:disabled,
.hbc-form-group select:disabled,
.hbc-form-group input[type="number"]:disabled,
.hbc-form-group textarea:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.6;
}

.hbc-form-group input[type="text"].error,
.hbc-form-group select.error,
.hbc-form-group input[type="number"].error,
.hbc-form-group textarea.error {
    border-color: #e74c3c;
    background-color: #fadbd8;
}

.hbc-form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.hbc-error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.hbc-swatch-preview-container {
    margin: 15px 0;
    text-align: center;
}

.hbc-swatch-preview {
    max-width: 150px;
    height: auto;
    border-radius: 4px;
    border: 2px solid #ddd;
    padding: 5px;
}

.hbc-add-to-cart-btn {
    width: 100%;
    padding: 15px;
    background-color: #333333;
    color: #ffffff;
    border: 2px solid #333333;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hbc-add-to-cart-btn:hover {
    background-color: #2c3e50;
    border-color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.hbc-add-to-cart-btn:disabled {
    background-color: #95a5a6;
    border-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.hbc-add-to-cart-btn:active {
    transform: translateY(0);
}

.hbc-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
}

.hbc-error-alert {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
}

/* ---------------------------------------------------------
   NEW STYLES FOR COLLAGES & HIERARCHY
--------------------------------------------------------- */

/* Collage Grids (Series & Colors) */
.hbc-collage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.hbc-collage-item {
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hbc-collage-item:hover {
    border-color: #999;
}

.hbc-collage-item.active {
    border-color: #333;
    background-color: #f0f0f0;
    font-weight: bold;
}

.hbc-collage-item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 5px;
    border-radius: 2px;
    display: block;
}

.hbc-item-label {
    font-size: 12px;
    line-height: 1.2;
}

/* Hierarchies (Controls & Cassettes) */
.hbc-hierarchy-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hbc-hierarchy-node {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hbc-toggle-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.hbc-toggle-item:hover {
    background: #f9f9f9;
}

.hbc-toggle-item.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.hbc-toggle-item img {
    max-height: 24px;
    width: auto;
}

.hbc-toggle-item.expanded {
    border-bottom: 1px solid #eee;
}

/* Cassette Colors Swatches */
.hbc-swatch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hbc-swatch-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease;
}

.hbc-swatch-item:hover {
    transform: scale(1.1);
}

.hbc-swatch-item.active {
    border-color: #333;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.hbc-swatch-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hbc-swatch-item.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    font-size: 10px;
    text-align: center;
}

/* Dimensions Row Tweaks */
.hbc-dimensions-row {
    align-items: flex-end;
    /* Align labels properly */
}

.hbc-small-input select {
    padding: 8px;
    /* Slightly smaller padding */
    font-size: 14px;
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hbc-form {
        padding: 20px;
    }

    .hbc-form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hbc-dimensions-row {
        grid-template-columns: 1fr 1fr !important;
        /* Keep dimensions side-by-side on mobile */
        display: grid !important;
    }

    .hbc-form-group input[type="text"],
    .hbc-form-group select,
    .hbc-form-group input[type="number"],
    .hbc-form-group textarea {
        padding: 10px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .hbc-form-group label {
        font-size: 13px;
    }

    .hbc-add-to-cart-btn {
        padding: 12px;
        font-size: 14px;
    }
}

/* Loading state */
.hbc-form.loading .hbc-add-to-cart-btn {
    opacity: 0.6;
    cursor: wait;
}

/* Accessibility */
.hbc-form-group input[type="text"]:focus,
.hbc-form-group select:focus,
.hbc-form-group input[type="number"]:focus,
.hbc-form-group textarea:focus,
.hbc-toggle-item:focus {
    outline: 2px solid #2c3e50;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .hbc-collage-item {
        width: calc(50% - 13px);
    }
}

/* =========================================
   NEW UI STYLES (v4.6)
   ========================================= */

/* Large Series Display + Specs */
.hbc-series-display-large {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.hbc-large-image {
    flex: 1;
    min-width: 250px;
}

.hbc-large-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #eee;
}

.hbc-specs-content {
    flex: 1;
    min-width: 250px;
}

.hbc-specs-content h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    color: #333;
}

.hbc-specs-table {
    width: 100%;
    border-collapse: collapse;
}

.hbc-specs-table th,
.hbc-specs-table td {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    text-align: left;
    font-size: 0.9em;
}

.hbc-specs-table th {
    font-weight: 600;
    color: #555;
    width: 40%;
}

/* Hierarchy Sections */
.hbc-hierarchy-section {
    margin-bottom: 25px;
}

.hbc-section-title {
    font-size: 1.1em;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    color: #444;
}

.hbc-section-title.sub-section {
    font-size: 1.0em;
    font-weight: 500;
    color: #666;
    margin-top: 15px;
    border-bottom: none;
    padding-left: 10px;
    border-left: 3px solid #eee;
}

.hbc-section-content {
    margin-left: 0;
}

/* Card Grid */
.hbc-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.hbc-card-item {
    border: 2px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    position: relative;
}

.hbc-card-item:hover {
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.hbc-card-item.active {
    border-color: #2271b1;
    /* WordPress Blue or Theme Color */
    box-shadow: 0 0 0 1px #2271b1;
}

.hbc-card-image {
    height: 140px;
    overflow: hidden;
    background: #f9f9f9;
    position: relative;
}

.hbc-card-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9em;
}

.hbc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.hbc-card-item:hover .hbc-card-image img {
    transform: scale(1.05);
}

.hbc-card-footer {
    padding: 12px;
    background: #fff;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.hbc-card-title {
    font-weight: 600;
    font-size: 0.95em;
    color: #333;
    display: block;
}

/* Check Icon Overlay */
.hbc-check-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #2271b1;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* INCREASED Swatch Size */
.hbc-swatch-item {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #eee;
    /* Thicker border */
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease;
}

.hbc-swatch-item:hover {
    transform: scale(1.05);
    border-color: #ccc;
}

.hbc-swatch-item.active {
    border-color: #2271b1;
    transform: scale(1.05);
    box-shadow: 0 0 0 2px #2271b1;
    /* Outer ring */
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .hbc-series-display-large {
        flex-direction: column;
    }

    .hbc-card-grid {
        grid-template-columns: 1fr 1fr;
        /* 2 col on mobile */
    }

    .hbc-swatch-item {
        width: 60px;
        /* Slightly smaller on mobile but still big */
        height: 60px;
    }
}