/* ==========================================================================
   Product Card Component & Quick View Modal Styles
   ========================================================================== */

/* Card Container */
.bms-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-sizing: border-box;
    padding:.5rem;
}

/* 1:1 Aspect Ratio Media Container */
.bms-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.bms-card-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.bms-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.bms-card-media:hover .bms-card-img {
    transform: scale(1.04);
}

/* Fulfillment Badge (Top Left) */
.bms-card-badge-wrap {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    pointer-events: none;
}

.bms-card-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 7px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.bms-badge-preorder  { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.bms-badge-threshold { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.bms-badge-mto       { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }

/* Action Overlay */
.bms-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(22, 22, 22, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 2;
    padding: 16px;
    box-sizing: border-box;
}

/* Reveal on Desktop Hover or Mobile Touch Active */
.bms-card-media:hover .bms-card-overlay,
.bms-card-media.is-touch-active .bms-card-overlay {
    opacity: 1;
    visibility: visible;
}

/* Action Buttons Inside Overlay */
.bms-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 180px;
    transform: translateY(8px);
    transition: transform 0.25s ease;
}

.bms-card-media:hover .bms-card-actions,
.bms-card-media.is-touch-active .bms-card-actions {
    transform: translateY(0);
}

.bms-action-btn,
.bms-card-cart-wrap .button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100% !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    text-align: center;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* Quick View Button (White Surface) */
.bms-quickview-btn {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border: none !important;
}
.bms-quickview-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
.bms-quickview-btn:hover {
    background: #f0f0f0 !important;
}

/* Add to Basket Button (Dark Solid) */
.bms-card-cart-wrap .button {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border: 1px solid #1a1a1a !important;
}
.bms-card-cart-wrap .button:hover {
    background: #333333 !important;
    border-color: #333333 !important;
}

/* Card Body & Typography */
.bms-card-info {
    padding: 12px 6px;
}
.bms-card-discipline {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #8c827a;
    margin-bottom: 4px;
}
.bms-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 4px 0;
}
.bms-card-title a {
    color: #1a1a1a;
    text-decoration: none;
}
.bms-card-title a:hover {
    text-decoration: underline;
}
.bms-card-maker {
    font-size: 13px;
    color: #666;
    margin: 0 0 6px 0;
}
.bms-card-maker a {
    color: #222;
    text-decoration: underline;
}
.bms-card-price {
    font-size: 14px;
    font-weight: 700;
    color: #111;
}

/* ==========================================================================
   Quick View Modal Styles
   ========================================================================== */

.bms-qv-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.bms-qv-modal.is-active {
    display: flex;
}

.bms-qv-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 15, 0.65);
    backdrop-filter: blur(4px);
}

.bms-qv-card {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    z-index: 2;
    padding: 36px;
    box-sizing: border-box;
}

.bms-qv-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #777;
    cursor: pointer;
    padding: 4px;
}
.bms-qv-close:hover {
    color: #000;
}

/* Quick View 2-Column Grid */
.bms-qv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}

@media (max-width: 768px) {
    .bms-qv-card { padding: 24px; }
    .bms-qv-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* Gallery & Thumbnails in Modal */
.bms-qv-viewport {
    width: 100%;
    background: #f8f8f8;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}
.bms-qv-hero-img {
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: contain;
    display: block;
    transition: opacity 0.15s ease;
}
.bms-qv-thumbs-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.bms-qv-thumb-btn {
    flex: 0 0 54px;
    height: 54px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: #eee;
    cursor: pointer;
    overflow: hidden;
}
.bms-qv-thumb-btn.is-active {
    border-color: #1a1a1a;
}
.bms-qv-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Modal Details */
.bms-qv-maker-kicker {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #8c827a;
    margin-bottom: 6px;
}
.bms-qv-maker-kicker a { color: inherit; text-decoration: underline; }
.bms-qv-title {
    font-size: 24px;
    line-height: 1.25;
    margin: 0 0 10px 0;
    font-weight: 600;
}
.bms-qv-price {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin-bottom: 14px;
}
.bms-qv-fulfillment-note {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 16px;
}
.bms-qv-fulfillment-note p {
    font-size: 12px;
    margin: 6px 0 0 0;
    color: #475569;
}
.bms-qv-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}
.bms-qv-cart-form form.cart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.bms-qv-cart-form .single_add_to_cart_button {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.bms-qv-permalink {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #222;
    text-decoration: underline;
}

/* Spinner Loader */
.bms-qv-loader {
    text-align: center;
    padding: 60px 20px;
}
.bms-qv-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #ddd;
    border-top-color: #222;
    border-radius: 50%;
    animation: bms-spin 0.7s linear infinite;
    margin-bottom: 12px;
}
@keyframes bms-spin {
    to { transform: rotate(360deg); }
}

/* Go to Product Button (Ghost Outline) */
.bms-goto-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}
.bms-goto-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: #ffffff !important;
}

/* Slightly expand the action area to comfortably fit 3 buttons */
.bms-card-actions {
    max-width: 200px;
}

/* Hide WooCommerce's native injected 'View cart' link on cards */
.bms-product-card .added_to_cart.wc-forward {
    display: none !important;
}