/**
 * SHG Closet Properties - Frontend Styles
 * Compact layout optimized for minimal scrolling
 */

/* Main Container */
.shg-closet-configurator {
    margin: 10px 0;
}

/* Config Sections - Compact spacing */
.shg-config-section {
    padding: 8px 0;
}

.shg-config-section:first-child {
    padding-top: 0;
}

/* Color section - first, compact */
.shg-color-section {
    padding: 0 0 12px 0;
    margin-bottom: 12px;
    border-bottom: none;
}

.shg-config-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.shg-selected-color-name {
    font-weight: 700;
    color: #000;
}

.shg-required {
    color: #d63638;
    margin-left: 3px;
}

/* Dimension Selector - Legacy dropdown */
.shg-dimension-select-wrapper {
    position: relative;
}

.shg-dimension-select {
    width: 100%;
    max-width: 400px;
    padding: 10px 40px 10px 12px;
    font-size: 14px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23333" d="M7 10l5 5 5-5z"/></svg>') no-repeat right 10px center;
    background-size: 20px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.shg-dimension-select:hover,
.shg-dimension-select:focus {
    border-color: #333;
    outline: none;
}

/* Dimension Button Groups - Compact */
.shg-dimension-section {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.shg-dimension-section:last-of-type {
    border-bottom: none;
    margin-bottom: 5px;
}

.shg-dimension-section .shg-config-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.shg-dimension-selected {
    font-weight: 700;
    color: #c9a86c;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
}

.shg-dimension-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.shg-dim-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 55px;
    text-align: center;
    color: #555;
    position: relative;
}

.shg-dim-btn:hover:not(:disabled):not(.active) {
    border-color: #c9a86c;
    background: #fffbf5;
    color: #333;
}

.shg-dim-btn.active {
    background: linear-gradient(135deg, #c9a86c 0%, #b8956a 100%);
    border-color: #c9a86c;
    color: #fff;
    box-shadow: 0 2px 8px rgba(201, 168, 108, 0.3);
}

.shg-dim-btn:disabled,
.shg-dim-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #f8f8f8;
    border-color: #e8e8e8;
    color: #aaa;
}

/* Custom button style */
.shg-dim-custom-btn {
    border-style: dashed;
    border-color: #ccc;
    color: #888;
    background: #fafafa;
    font-weight: 500;
    font-size: 12px;
    padding: 8px 12px;
    min-width: auto;
}

.shg-dim-custom-btn:hover:not(:disabled):not(.active) {
    border-color: #c9a86c;
    background: #fffbf5;
    color: #c9a86c;
}

.shg-dim-custom-btn.active {
    background: linear-gradient(135deg, #c9a86c 0%, #b8956a 100%);
    border-color: #c9a86c;
    border-style: solid;
    color: #fff;
}

/* Custom Dimensions - Compact */
.shg-custom-dimensions {
    margin-top: 12px;
    padding: 14px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.shg-custom-dimensions-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.shg-custom-dimensions-inputs {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.shg-dimension-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shg-dimension-input-group label {
    font-size: 10px;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
}

.shg-dimension-input-group input {
    width: 70px;
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
    background: #fff;
}

.shg-dimension-input-group input:focus {
    border-color: #c9a86c;
    outline: none;
    box-shadow: 0 0 0 2px rgba(201, 168, 108, 0.15);
}

.shg-dimension-input-group input:invalid {
    border-color: #d63638;
}

.shg-dimension-separator {
    font-size: 18px;
    color: #bbb;
    padding-bottom: 6px;
    font-weight: 300;
}

.shg-dimension-unit {
    font-size: 12px;
    color: #888;
    padding-bottom: 10px;
    margin-left: 4px;
}

.shg-custom-dimension-price-note {
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 12px;
    color: #666;
    background: #fff;
    border-radius: 4px;
    border-left: 3px solid #c9a86c;
}

/* Color Selector - Compact */
.shg-color-selector-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* All Color Swatches Container (Basic + Category-specific) */
.shg-all-colors {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.shg-basic-color-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.shg-basic-color-swatch:hover {
    transform: scale(1.08);
}

.shg-basic-color-swatch .shg-color-fill,
.shg-basic-color-swatch img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    display: block;
    object-fit: cover;
}

.shg-basic-color-swatch:hover .shg-color-fill,
.shg-basic-color-swatch:hover img {
    border-color: #999;
}

.shg-basic-color-swatch.selected .shg-color-fill,
.shg-basic-color-swatch.selected img {
    border-color: #c9a86c;
    box-shadow: 0 0 0 2px rgba(201, 168, 108, 0.3);
}

.shg-basic-color-swatch .shg-color-name {
    font-size: 9px;
    color: #777;
    text-align: center;
    max-width: 50px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shg-basic-color-swatch.selected .shg-color-name {
    color: #333;
    font-weight: 600;
}

/* Color Buttons Row */
.shg-color-buttons-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Color Preview Box - Compact */
.shg-color-preview {
    flex-shrink: 0;
}

.shg-color-preview-box {
    width: 50px;
    height: 50px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.shg-color-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shg-color-preview-box .shg-no-color {
    font-size: 9px;
    color: #999;
    text-align: center;
    padding: 5px;
}

/* Catalog Buttons - Compact */
.shg-color-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.shg-catalog-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.shg-catalog-btn:hover {
    border-color: #c9a86c;
    background: #fffbf5;
}

.shg-catalog-btn:focus {
    outline: none;
    border-color: #c9a86c;
}

/* Options Section (LED, GOLA checkboxes) - Compact inline */
.shg-options-section {
    padding: 6px 0;
    border-bottom: none !important;
}

.shg-option-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

.shg-option-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #c9a86c;
}

.shg-option-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shg-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 10px;
    font-weight: bold;
    color: #888;
    background: #eee;
    border-radius: 50%;
    cursor: help;
}

.shg-option-price {
    color: #888;
    font-size: 12px;
    margin-left: 4px;
}

/* Door Type Selection - Compact */
.shg-doors-section {
    padding: 8px 0;
    border-bottom: none !important;
}

.shg-doors-section .shg-config-label {
    margin-bottom: 6px;
    font-size: 13px;
}

.shg-door-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.shg-door-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

.shg-door-option input[type="radio"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: #c9a86c;
}

.shg-door-label {
    font-weight: 400;
}

/* Price Display Section - Compact */
.shg-price-section {
    padding: 12px 0 0 0;
    margin-top: 10px;
    border-top: 1px solid #ddd;
    border-bottom: none !important;
}

/* Price-only mode - clean spacing when no configurator options */
.shg-price-section.shg-price-only {
    padding: 10px 0 0 0;
    margin-top: 10px;
    border-top: 1px solid #eee;
}

.shg-price-display {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
}

.shg-price-label {
    display: none;
}

.shg-price-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

/* Modal Overlay */
.shg-color-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.shg-color-modal.active {
    display: flex;
}

/* Force hide Divi header when modal is open */
body.shg-modal-open #main-header,
body.shg-modal-open #top-header,
body.shg-modal-open .et-fixed-header,
body.shg-modal-open header#main-header,
body.shg-modal-open #et-main-area > header,
body.shg-modal-open .et_pb_menu,
body.shg-modal-open #page-container > header {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Prevent body scroll when modal is open */
body.shg-modal-open {
    overflow: hidden !important;
}

/* Modal Content */
.shg-color-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

/* Close Button */
.shg-color-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s;
}

.shg-color-modal-close:hover {
    color: #000;
}

/* Modal Header */
.shg-modal-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.shg-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #333;
}

.shg-modal-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Category Tabs */
.shg-category-tabs {
    display: flex;
    gap: 5px;
    padding: 10px 20px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    justify-content: center;
    flex-shrink: 0;
}

.shg-category-tab {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    color: #666;
    white-space: nowrap;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.shg-category-tab:hover {
    color: #333;
    background: #f0f0f0;
    border-color: #bbb;
}

.shg-category-tab.active {
    color: #fff;
    background: #c9a86c;
    border-color: #c9a86c;
    font-weight: 600;
}

.shg-category-tab.active:hover {
    background: #b8956a;
    border-color: #b8956a;
}

/* Samples Container */
.shg-samples-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
    position: relative;
}

/* Samples Grid */
.shg-samples-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Sample Item */
.shg-sample-item {
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
}

.shg-sample-item:hover {
    transform: translateY(-3px);
}

.shg-sample-item.selected .shg-sample-image-wrap {
    border-color: #c9a86c;
    box-shadow: 0 0 0 3px rgba(201, 168, 108, 0.3);
}

.shg-sample-image-wrap {
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s;
    background: #f5f5f5;
}

.shg-sample-image-wrap:hover {
    border-color: #ddd;
}

.shg-sample-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shg-sample-name {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #333;
    line-height: 1.3;
}

/* Loading State */
.shg-samples-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
}

.shg-samples-loading.active {
    display: flex;
}

.shg-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #eee;
    border-top-color: #c9a86c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* No Samples Message */
.shg-no-samples {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Modal Footer */
.shg-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #eee;
    text-align: center;
    background: #fafafa;
    flex-shrink: 0;
}

.shg-continue-btn {
    padding: 15px 50px;
    font-size: 16px;
    font-weight: 600;
    background: #c9a86c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shg-continue-btn:hover:not(:disabled) {
    background: #b8956a;
}

.shg-continue-btn:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

/* Cart Color Display */
.shg-cart-color {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.shg-cart-color-img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
}

/* Validation Errors */
.shg-closet-configurator.error .shg-dimension-select,
.shg-closet-configurator.error-dimension .shg-dimension-select {
    border-color: #d63638;
}

.shg-closet-configurator.error-dimension .shg-dim-btn:not(.active) {
    border-color: #d63638;
}

.shg-closet-configurator.error .shg-color-preview-box,
.shg-closet-configurator.error-color .shg-color-preview-box {
    border-color: #d63638;
}

.shg-closet-configurator .shg-error-message {
    color: #d63638;
    font-size: 13px;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .shg-samples-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .shg-color-modal-content {
        max-height: 95vh;
        border-radius: 0;
    }

    .shg-modal-header {
        padding: 20px 15px 15px;
    }

    .shg-modal-title {
        font-size: 18px;
    }

    .shg-category-tabs {
        padding: 0 10px;
    }

    .shg-category-tab {
        padding: 12px 15px;
        font-size: 11px;
    }

    .shg-samples-container {
        padding: 15px;
    }

    .shg-dimension-select {
        max-width: 100%;
    }

    .shg-door-options {
        flex-direction: column;
        gap: 12px;
    }

    /* Color selector tablet responsive */
    .shg-color-preview-box {
        width: 45px;
        height: 45px;
    }

    .shg-basic-color-swatch .shg-color-fill,
    .shg-basic-color-swatch img {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .shg-samples-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Color selector - keep horizontal layout on mobile */
    .shg-color-selector-content {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
    }

    /* Color swatches - horizontal scrolling row */
    .shg-all-colors {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding-bottom: 5px;
        max-width: calc(100vw - 160px);
    }

    /* Buttons row - keep Lioher button and preview on same row */
    .shg-color-buttons-row {
        flex-shrink: 0;
        gap: 8px;
    }

    /* Smaller preview box for mobile */
    .shg-color-preview-box {
        width: 36px;
        height: 36px;
    }

    .shg-color-buttons {
        flex-direction: row;
        width: auto;
    }

    .shg-catalog-btn {
        flex: none;
        min-width: auto;
        padding: 8px 12px;
        font-size: 11px;
    }

    .shg-custom-dimensions-inputs {
        gap: 8px;
    }

    .shg-dimension-input-group input {
        width: 65px;
        padding: 8px 10px;
        font-size: 14px;
    }

    .shg-dimension-separator {
        font-size: 16px;
    }

    .shg-price-value {
        font-size: 22px;
    }

    /* Dimension buttons responsive */
    .shg-dim-btn {
        padding: 7px 12px;
        font-size: 12px;
        min-width: 48px;
        border-radius: 5px;
    }

    .shg-dimension-buttons {
        gap: 5px;
    }

    .shg-dimension-section .shg-config-label {
        font-size: 12px;
    }

    .shg-custom-dimensions {
        padding: 12px;
    }

    .shg-dimension-input-group input {
        width: 60px;
        padding: 8px;
        font-size: 13px;
    }

    /* Color swatches responsive - smaller circles */
    .shg-basic-color-swatch .shg-color-fill,
    .shg-basic-color-swatch img {
        width: 28px;
        height: 28px;
    }

    .shg-basic-color-swatch .shg-color-name {
        font-size: 7px;
        max-width: 32px;
    }

    .shg-basic-color-swatch {
        gap: 2px;
    }
}

/* Category-Specific Color Swatches (same as basic colors) */
.shg-category-color-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.shg-category-color-swatch:hover {
    transform: scale(1.08);
}

.shg-category-color-swatch .shg-color-fill,
.shg-category-color-swatch img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    display: block;
    object-fit: cover;
}

.shg-category-color-swatch:hover .shg-color-fill,
.shg-category-color-swatch:hover img {
    border-color: #999;
}

.shg-category-color-swatch.selected .shg-color-fill,
.shg-category-color-swatch.selected img {
    border-color: #c9a86c;
    box-shadow: 0 0 0 2px rgba(201, 168, 108, 0.3);
}

.shg-category-color-swatch .shg-color-name {
    font-size: 9px;
    color: #777;
    text-align: center;
    max-width: 50px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shg-category-color-swatch.selected .shg-color-name {
    color: #333;
    font-weight: 600;
}

@media (max-width: 768px) {
    .shg-category-color-swatch .shg-color-fill,
    .shg-category-color-swatch img {
        width: 32px;
        height: 32px;
    }

    .shg-category-color-swatch .shg-color-name {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .shg-category-color-swatch .shg-color-fill,
    .shg-category-color-swatch img {
        width: 28px;
        height: 28px;
    }

    .shg-category-color-swatch .shg-color-name {
        font-size: 7px;
        max-width: 32px;
    }

    .shg-category-color-swatch {
        gap: 2px;
    }
}

/* Lioher Preview Swatches (shown in lioher_only mode next to button) */
.shg-lioher-preview-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.shg-lioher-preview-swatch:hover {
    transform: scale(1.08);
}

.shg-lioher-preview-swatch .shg-color-fill,
.shg-lioher-preview-swatch img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    display: block;
    object-fit: cover;
}

.shg-lioher-preview-swatch:hover .shg-color-fill,
.shg-lioher-preview-swatch:hover img {
    border-color: #999;
}

.shg-lioher-preview-swatch.selected .shg-color-fill,
.shg-lioher-preview-swatch.selected img {
    border-color: #c9a86c;
    box-shadow: 0 0 0 2px rgba(201, 168, 108, 0.3);
}

.shg-lioher-preview-swatch .shg-color-name {
    font-size: 9px;
    color: #777;
    text-align: center;
    max-width: 50px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shg-lioher-preview-swatch.selected .shg-color-name {
    color: #333;
    font-weight: 600;
}

@media (max-width: 768px) {
    .shg-lioher-preview-swatch .shg-color-fill,
    .shg-lioher-preview-swatch img {
        width: 32px;
        height: 32px;
    }

    .shg-lioher-preview-swatch .shg-color-name {
        font-size: 8px;
    }
}

/* ============================================
   WOOCOMMERCE GALLERY - CLOSET PRODUCTS
   Square-ish display for portrait renders
   ============================================ */

/* Hide the Flexslider overflow to prevent partial images on sides */
.woocommerce-product-gallery {
    overflow: hidden !important;
}

/* Limit gallery height for portrait images to look more square */
.woocommerce-product-gallery .flex-viewport {
    max-height: 600px !important;
    overflow: hidden !important;
    background: #fff;
}
/* Note: Do NOT add display:flex or width:100% to FlexSlider elements
   as this breaks the slider mechanics. FlexSlider uses float and
   percentage-based widths for sliding between images. */

/* ============================================
   RENDER GALLERY STYLES
   For dynamic color renders with thumbnails
   ============================================ */

/* Render mode gallery container */
.woocommerce-product-gallery.shg-render-mode {
    position: relative;
}

/* Main render wrapper - match WooCommerce gallery structure */
.shg-render-wrapper {
    position: relative;
    margin: 0;
    padding: 0;
}

/* Main render image container */
.shg-render-main-image {
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
}

.shg-render-main-image a {
    display: block;
    cursor: default;
}

/* Main render image - match original gallery dimensions */
.shg-render-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    background-color: #fff;
}

/* Render slides - ensure proper sizing */
.shg-render-slide {
    width: 100% !important;
}

.shg-render-slide a {
    display: block;
    width: 100%;
    cursor: zoom-in;
}

.shg-render-slide img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    max-width: 100% !important;
}

/* Render viewport */
.shg-render-viewport {
    width: 100%;
}

.shg-render-viewport .shg-render-wrapper {
    width: 100% !important;
}


/* ============================================
   LIGHTBOX STYLES
   For render image zoom (like WooCommerce PhotoSwipe)
   ============================================ */

/* Prevent body scroll when lightbox is open */
body.shg-lightbox-open {
    overflow: hidden;
}

/* Lightbox overlay */
.shg-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

.shg-lightbox-overlay.active {
    opacity: 1;
}

/* Lightbox container */
.shg-lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Close button */
.shg-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    line-height: 1;
    padding: 0;
}

.shg-lightbox-close:hover {
    opacity: 1;
}

/* Lightbox content */
.shg-lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.shg-lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: default;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .shg-lightbox-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .shg-lightbox-content img {
        max-width: 95vw;
        max-height: 80vh;
    }
}

/* ============================================
   WOOCOMMERCE GALLERY THUMBNAILS
   Ensure consistent thumbnail sizing for all images
   ============================================ */

/* Gallery thumbnail container - standard WooCommerce */
.woocommerce-product-gallery .flex-control-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 0;
    list-style: none;
}

.woocommerce-product-gallery .flex-control-thumbs li {
    flex: 0 0 auto;
    width: 80px !important;
    height: 80px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woocommerce-product-gallery .flex-control-thumbs li img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 !important;
}

/* Active thumbnail state */
.woocommerce-product-gallery .flex-control-thumbs li img.flex-active {
    border: none;
    opacity: 1;
}

/* Render thumbnails - match WooCommerce gallery styling */
.shg-render-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 0;
    list-style: none;
}

.shg-render-thumb {
    flex: 0 0 auto;
    width: 80px !important;
    height: 80px !important;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shg-render-thumb:hover {
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.shg-render-thumb.shg-thumb-active {
    border-color: #000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.shg-render-thumb img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    pointer-events: none;
}

/* Responsive gallery thumbnails */
@media (max-width: 768px) {
    .woocommerce-product-gallery .flex-control-thumbs li,
    .shg-render-thumb {
        width: 60px !important;
        height: 60px !important;
    }

    .woocommerce-product-gallery .flex-control-thumbs,
    .shg-render-thumbnails {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .woocommerce-product-gallery .flex-control-thumbs li,
    .shg-render-thumb {
        width: 50px !important;
        height: 50px !important;
    }

    .woocommerce-product-gallery .flex-control-thumbs,
    .shg-render-thumbnails {
        gap: 6px;
    }
}

/* ============================================
   CART RENDER IMAGES
   Control cart thumbnail size for color renders
   ============================================ */

/* WooCommerce Blocks cart - ensure images display properly */
.wc-block-cart-item__image img {
    object-fit: contain !important;
}

/* Classic cart thumbnail */
.shg-cart-render-thumbnail {
    object-fit: contain !important;
}

/* ============================================
   CART IMAGE LOADING TRANSITION
   Smooth transition when cart image updates
   ============================================ */

/* WooCommerce Blocks cart - cart images display immediately
   Store API now returns correct render URLs from shg-renders-cart folder */

/* ============================================
   AJAX ADD TO CART NOTICE (Toast Style)
   Fixed position in bottom-right corner
   ============================================ */

.shg-cart-notice {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 24px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    max-width: 420px;
    animation: shg-toast-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shg-toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.shg-cart-notice.shg-notice-hiding {
    animation: shg-toast-slide-out 0.3s ease-in forwards;
}

@keyframes shg-toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.shg-cart-notice-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.shg-cart-notice-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.shg-cart-notice-content {
    flex: 1;
}

.shg-cart-notice-button {
    display: inline-block;
    padding: 8px 18px;
    background-color: #c9a66b;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.shg-cart-notice-button:hover {
    background-color: #b8965f;
    color: #fff !important;
}

.shg-cart-notice-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shg-cart-notice-close:hover {
    opacity: 1;
}

/* Add to cart button loading state */
form.cart button[type="submit"].loading {
    opacity: 0.7;
    cursor: wait;
}

/* Hide WooCommerce's default "View Cart" link after AJAX add to cart
   We have our own notification with View Cart button */
form.cart .added_to_cart,
.woocommerce-message .button.wc-forward,
form.cart + .woocommerce-message {
    display: none !important;
}

/* If WooCommerce message shows, style it properly */
.woocommerce-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 20px;
    border-radius: 6px;
    margin: 15px 0;
}

@media (max-width: 480px) {
    .shg-cart-notice {
        flex-wrap: wrap;
        gap: 10px;
    }

    .shg-cart-notice-button {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   WOOCOMMERCE GALLERY - PORTRAIT IMAGE FIX
   For closet renders with portrait orientation
   NOTE: Don't override FlexSlider's essential mechanics
   ============================================ */

/* Center the image WITHIN its slide container */
.woocommerce-product-gallery .woocommerce-product-gallery__image {
    text-align: center;
}

/* Portrait image sizing - maintain aspect ratio, center within container */
.woocommerce-product-gallery .woocommerce-product-gallery__image img.wp-post-image,
.woocommerce-product-gallery .woocommerce-product-gallery__image > a > img {
    max-height: 600px;
    width: auto !important;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: inline-block !important;
}

/* Thumbnail navigation - fix for portrait images */
.woocommerce-product-gallery .flex-control-thumbs {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 10px;
    padding: 0;
    list-style: none;
}

.woocommerce-product-gallery .flex-control-thumbs li {
    width: 70px !important;
    height: 100px !important;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}

.woocommerce-product-gallery .flex-control-thumbs li img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/* Active thumbnail highlight */
.woocommerce-product-gallery .flex-control-thumbs li img.flex-active {
    border: 2px solid #cfac77;
}

/* Ensure zoom trigger stays in position */
.woocommerce-product-gallery .woocommerce-product-gallery__trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}
