/* ── DuraCoat Color Grid ─────────────────────────────────────────────── */

/* Grid layout — fills container width; columns share space equally */
.dc-color-grid {
    display: grid;
    grid-template-columns: repeat(var(--dc-cols, 10), 1fr);
    gap: 8px;
    margin: 24px 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

/* On small screens, ignore the explicit column count and instead
 * create as many columns as will fit while keeping a minimum square
 * size for usability (scroll vertically for more colors). */
@media (max-width: 768px) {
    .dc-color-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    /* On mobile, only show product title on hover, hide featured label
     * to keep the overlay clean and readable on small squares. */
    .dc-swatch-label-featured {
        display: none;
    }
}

/* Individual swatch — square, fills its grid cell */
.dc-swatch {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    min-height: 0;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    background-color: #ccc; /* fallback */
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    outline: none;
}

 .dc-swatch:hover,
 .dc-swatch:focus-visible {
     transform: scale(1.22);
     box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
     border-color: rgba(0, 0, 0, 0.4);
     z-index: 3;
 }

 .dc-swatch:active {
     transform: scale(1.15);
 }

/* On-swatch hover label */
.dc-swatch-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-align: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.3));
    color: #fff;
    border-radius: 6px;
    pointer-events: none; /* keep swatch fully clickable */
    opacity: 0;
    transition: opacity 0.16s ease;
    z-index: 10;
}

.dc-swatch:hover .dc-swatch-label,
.dc-swatch:focus-visible .dc-swatch-label {
    opacity: 1;
}

.dc-swatch-label-name {
    font-size: 8px;
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 2px;
    max-width: 90%;
    overflow: clip;
    word-wrap: break-word;
    white-space: normal;
}

.dc-swatch-label-featured {
    display: none;
    /* font-size: 9px; 
    font-weight: 400;
    opacity: 0.9;
    max-width: 90%;
    line-height: 1.3;
    word-wrap: break-word;
    white-space: normal;*/
}

/* ── Modal overlay ───────────────────────────────────────────────────── */

/* Respect the [hidden] attribute so the overlay is not shown or clickable
 * until the JS explicitly reveals it. This prevents it from blocking the
 * entire site on pages where the shortcode/modal hasn't been opened. */
#dc-quickview-overlay[hidden] {
    display: none !important;
}

#dc-quickview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* JS removes [hidden] attr; we use opacity for animation */
    opacity: 0;
    transition: opacity 0.22s ease;
}

#dc-quickview-overlay.dc-visible {
    opacity: 1;
}

#dc-quickview-modal {
    position: relative;
    background: #fff;
    border-radius: 10px;
    max-width: 780px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: translateY(16px);
    transition: transform 0.22s ease;
}

#dc-quickview-overlay.dc-visible #dc-quickview-modal {
    transform: translateY(0);
}

/* Modal buttons: black / white, 7px radius, 14pt — !important wins over theme/Woo */
#dc-quickview-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 2;
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #000 !important;
    border-radius: 7px !important;
    font-size: 14pt !important;
    line-height: 1.2 !important;
    padding: 0.35em 0.55em !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#dc-quickview-close:hover,
#dc-quickview-close:focus {
    background: #1a1a1a !important;
    color: #fff !important;
    border-color: #1a1a1a !important;
}

#dc-quickview-modal .dc-qv-cart-form .single_add_to_cart_button,
#dc-quickview-modal .dc-qv-cart-form button[type="submit"].single_add_to_cart_button {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #000 !important;
    border-radius: 7px !important;
    font-size: 14pt !important;
    line-height: 1.2 !important;
    padding: 0.5em 1em !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#dc-quickview-modal .dc-qv-cart-form .single_add_to_cart_button:hover,
#dc-quickview-modal .dc-qv-cart-form .single_add_to_cart_button:focus {
    background: #1a1a1a !important;
    color: #fff !important;
    border-color: #1a1a1a !important;
}

#dc-quickview-modal a.dc-qv-view-full.button {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #000 !important;
    border-radius: 7px !important;
    font-size: 14pt !important;
    line-height: 1.2 !important;
    padding: 0.5em 1em !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-decoration: none !important;
}

#dc-quickview-modal a.dc-qv-view-full.button:hover,
#dc-quickview-modal a.dc-qv-view-full.button:focus {
    background: #1a1a1a !important;
    color: #fff !important;
    border-color: #1a1a1a !important;
}

/* ── Loader ──────────────────────────────────────────────────────────── */

#dc-quickview-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.dc-spinner {
    display: inline-block;
    width: 38px;
    height: 38px;
    border: 4px solid #eee;
    border-top-color: #333;
    border-radius: 50%;
    animation: dc-spin 0.7s linear infinite;
}

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

/* ── Quick-view inner layout ─────────────────────────────────────────── */

.dc-qv-inner {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 600px) {
    .dc-qv-inner {
        grid-template-columns: 1fr;
    }
    #dc-quickview-modal {
        padding: 24px 18px;
    }
}

/* Color swatch in modal */
.dc-qv-hex-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid rgba(0,0,0,0.1);
}

.dc-qv-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Text / form area */
.dc-qv-title {
    font-size: 1.4em;
    margin: 0 0 10px;
    line-height: 1.3;
}

.dc-qv-short-desc {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.5;
}

.dc-qv-price {
    font-size: 1.25em;
    font-weight: 700;
    margin-bottom: 18px;
    color: #333;
}

/* Variation table inside modal */
.dc-qv-cart-form .variations {
    width: 100%;
    margin-bottom: 14px;
    border-collapse: collapse;
}

.dc-qv-cart-form .variations th,
.dc-qv-cart-form .variations td {
    padding: 6px 0;
    vertical-align: middle;
    font-size: 0.9em;
}

.dc-qv-cart-form .variations th {
    width: 120px;
    font-weight: 600;
    padding-right: 12px;
    color: #444;
}

.dc-qv-cart-form select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    background: #fff;
}

/* Quantity + ATC row */
.dc-qv-cart-form .quantity {
    display: inline-block;
    margin-right: 10px;
}

.dc-qv-cart-form .qty {
    width: 60px;
    padding: 9px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    text-align: center;
}

/* Single variation description / price inside modal */
.single_variation {
    margin-bottom: 12px;
    font-size: 0.9em;
}

.dc-qv-view-full {
    display: inline-block;
    margin-top: 14px;
}

/* WC notices inside modal */
.dc-qv-inner .woocommerce-message,
.dc-qv-inner .woocommerce-error {
    font-size: 0.88em;
    margin: 8px 0;
}

/* Error state */
.dc-grid-error {
    color: #c00;
    font-size: 0.9em;
    padding: 10px;
    background: #fff3f3;
    border-left: 3px solid #c00;
}
