/* =========================================================
   HexaGears Product Enquiry — Front-end styles
   Matches the premium, dark-accent aesthetic of hsngc.com
   ========================================================= */

:root {
    --hex-primary: #111111;
    --hex-primary-hover: #2a2a2a;
    --hex-accent: #c8a35a;        /* warm gold accent that fits the leather/premium feel */
    --hex-text: #1a1a1a;
    --hex-text-light: #6b6b6b;
    --hex-border: #e5e5e5;
    --hex-bg: #ffffff;
    --hex-bg-soft: #f7f7f8;
    --hex-error: #d62c2c;
    --hex-success: #16794c;
    --hex-radius: 12px;
    --hex-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
}

/* ---------- Enquiry buttons on shop / single ---------- */
.hexagears-enquiry-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--hex-primary) !important;
    color: #ffffff !important;
    border: 1.5px solid var(--hex-primary) !important;
    padding: 11px 22px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-decoration: none !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1.2 !important;
}

.hexagears-enquiry-btn:hover,
.hexagears-enquiry-btn:focus {
    background: var(--hex-accent) !important;
    border-color: var(--hex-accent) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(200, 163, 90, 0.3);
}

.hexagears-enquiry-btn--single {
    padding: 14px 32px !important;
    font-size: 15px !important;
}

.hexagears-enquiry-single-wrap {
    margin: 20px 0;
}

/* Tidy up loop spacing on shop pages */
.woocommerce ul.products li.product .hexagears-enquiry-btn--loop {
    margin-top: 8px;
}

/* ---------- Overlay ---------- */
.hexagears-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 15, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.hexagears-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* ---------- Modal ---------- */
.hexagears-modal {
    position: relative;
    background: var(--hex-bg);
    width: 100%;
    max-width: 920px;
    max-height: calc(100vh - 40px);
    border-radius: var(--hex-radius);
    box-shadow: var(--hex-shadow);
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.hexagears-overlay.is-active .hexagears-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.hexagears-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: var(--hex-primary);
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hexagears-close:hover {
    background: var(--hex-primary);
    color: #ffffff;
    transform: rotate(90deg);
}

/* ---------- Grid layout (left image / right form) ---------- */
.hexagears-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    min-height: 540px;
    max-height: calc(100vh - 40px);
    /* min-height: 0 on the grid children allows their overflow-y:auto to kick in */
}

.hexagears-modal-grid > * {
    min-height: 0;
}

/* LEFT — product image */
.hexagears-modal-left {
    background: linear-gradient(135deg, #f7f7f8 0%, #ececee 100%);
    padding: 36px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hexagears-modal-left::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: var(--hex-accent);
    opacity: 0.08;
    border-radius: 50%;
    pointer-events: none;
}

.hexagears-modal-left::after {
    content: "";
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 240px;
    height: 240px;
    background: var(--hex-primary);
    opacity: 0.04;
    border-radius: 50%;
    pointer-events: none;
}

.hexagears-product-image-wrap {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hexagears-product-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.hexagears-product-meta {
    position: relative;
    z-index: 1;
    margin-top: 22px;
    text-align: center;
}

.hexagears-product-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--hex-accent);
    margin-bottom: 6px;
}

.hexagears-product-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--hex-text);
    margin: 0;
    line-height: 1.4;
}

/* RIGHT — form */
.hexagears-modal-right {
    padding: 32px 36px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
}

.hexagears-modal-logo {
    margin-bottom: 14px;
}

.hexagears-modal-logo img {
    max-width: 80px;
    height: auto;
    display: block;
}

.hexagears-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--hex-text);
    margin: 0 0 6px;
    line-height: 1.2;
}

.hexagears-modal-subtitle {
    font-size: 13.5px;
    color: var(--hex-text-light);
    margin: 0 0 20px;
    line-height: 1.5;
}

/* Form rows */
.hexagears-form-row {
    margin-bottom: 16px;
}

.hexagears-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--hex-text);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.hexagears-form-row label span {
    color: var(--hex-error);
}

.hexagears-enquiry-form input[type="text"],
.hexagears-enquiry-form input[type="email"],
.hexagears-enquiry-form input[type="tel"],
.hexagears-enquiry-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--hex-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--hex-text);
    background: var(--hex-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    line-height: 1.4;
}

.hexagears-enquiry-form input:focus,
.hexagears-enquiry-form textarea:focus {
    outline: none;
    border-color: var(--hex-primary);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.hexagears-enquiry-form textarea {
    resize: vertical;
    min-height: 90px;
}

.hexagears-enquiry-form input.has-error,
.hexagears-enquiry-form textarea.has-error {
    border-color: var(--hex-error);
    box-shadow: 0 0 0 3px rgba(214, 44, 44, 0.08);
}

/* Submit button */
.hexagears-submit-btn {
    width: 100%;
    background: var(--hex-primary);
    color: #ffffff;
    border: none;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    transition: all 0.25s ease;
    font-family: inherit;
}

.hexagears-submit-btn:hover:not(:disabled) {
    background: var(--hex-accent);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(200, 163, 90, 0.35);
}

.hexagears-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.hexagears-submit-btn.is-loading .hexagears-btn-text::after {
    content: "...";
    animation: hex-dots 1.4s infinite;
}

.hexagears-submit-btn.is-loading .hexagears-btn-icon {
    animation: hex-spin 1s linear infinite;
}

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

@keyframes hex-dots {
    0%, 20%   { content: "."; }
    40%       { content: ".."; }
    60%, 100% { content: "..."; }
}

/* Form message */
.hexagears-form-message {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

.hexagears-form-message.is-error {
    display: block;
    background: rgba(214, 44, 44, 0.08);
    color: var(--hex-error);
    border: 1px solid rgba(214, 44, 44, 0.2);
}

.hexagears-form-message.is-success {
    display: block;
    background: rgba(22, 121, 76, 0.08);
    color: var(--hex-success);
    border: 1px solid rgba(22, 121, 76, 0.2);
}

/* Lock body scroll when modal open */
body.hexagears-modal-open {
    overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .hexagears-overlay {
        padding: 0;
        align-items: stretch;
    }

    .hexagears-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }

    .hexagears-modal-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        min-height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
    }

    .hexagears-modal-left {
        padding: 24px 20px 18px;
    }

    .hexagears-product-image-wrap {
        aspect-ratio: auto;
        max-height: 180px;
        padding: 12px;
    }

    .hexagears-product-meta {
        margin-top: 14px;
    }

    .hexagears-product-name {
        font-size: 15px;
    }

    .hexagears-modal-right {
        padding: 24px 22px 30px;
    }

    .hexagears-modal-title {
        font-size: 22px;
    }

    .hexagears-modal-logo img {
        max-width: 70px;
    }

    .hexagears-close {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 480px) {
    .hexagears-form-row {
        margin-bottom: 12px;
    }

    .hexagears-enquiry-form textarea {
        min-height: 70px;
    }
}
