/* Collection Browser UX */

.bihome-collections-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 320px));
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    margin-bottom: 60px;
}

@media (max-width: 991px) {
    .bihome-collections-grid {
        grid-template-columns: repeat(2, minmax(0, 340px));
        gap: 24px;
    }
}

@media (max-width: 575px) {
    .bihome-collections-grid {
        grid-template-columns: repeat(1, minmax(0, 340px));
        gap: 20px;
    }
}

.bihome-col-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bihome-col-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(12, 64, 105, 0.1);
    border-color: #0c4069;
}

.bihome-col-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #fbfbfb;
}

.bihome-col-main-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
    transition: transform 0.5s ease;
    mix-blend-mode: multiply;
}

.bihome-col-card:hover .bihome-col-main-img {
    transform: scale(1.05);
}

.bihome-col-sizes-overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 64, 105, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.bihome-col-card:hover .bihome-col-sizes-overlay {
    opacity: 1;
    visibility: visible;
}

.bihome-col-sizes-title {
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.bihome-col-sizes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.bihome-size-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.bihome-size-btn:hover, .bihome-size-btn.active {
    background: #cc685c;
    border-color: #cc685c;
}

.bihome-col-info {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e5e3dd;
}

.bihome-col-name {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #0c4069;
    font-weight: 600;
}

.bihome-col-count {
    font-size: 13px;
    color: #777;
}

/* Global Modal - Premium Styling */
.bihome-colors-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.bihome-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 47, 0.65); /* Navy tint */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bihome-modal-content {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(12, 64, 105, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: bihomeModalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bihomeModalFadeIn {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.bihome-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid #f0eee9;
    background: #fdfbf9; /* Warm off-white */
}

.bihome-modal-title {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 20px;
    color: #0c4069;
    font-weight: 500;
    letter-spacing: -0.01em;
}

#modal-col-name {
    font-weight: 700;
}

#modal-size-name {
    color: #cc685c;
    font-weight: 600;
}

.bihome-modal-close {
    background: #f1f0ec;
    border: none;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #555;
    transition: all 0.3s ease;
}

.bihome-modal-close:hover {
    background: #e5e3dd;
    color: #111;
    transform: rotate(90deg);
}

.bihome-modal-items {
    padding: 30px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

/* Custom Scrollbar for Modal Items */
.bihome-modal-items::-webkit-scrollbar {
    width: 6px;
}
.bihome-modal-items::-webkit-scrollbar-track {
    background: #fdfbf9;
}
.bihome-modal-items::-webkit-scrollbar-thumb {
    background: #e5e3dd;
    border-radius: 3px;
}
.bihome-modal-items::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.bihome-modal-color-item {
    position: relative;
    display: block;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    background: #fff;
    border: 1px solid #e5e3dd;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bihome-modal-color-item:hover {
    border-color: #0c4069;
    box-shadow: 0 16px 36px rgba(12, 64, 105, 0.12);
    transform: translateY(-4px);
}

.bihome-modal-img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fdfcfb;
    overflow: hidden;
}

.bihome-modal-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    mix-blend-mode: multiply;
    display: block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bihome-modal-color-item:hover .bihome-modal-img-wrapper img {
    transform: scale(1.05);
}

/* Glassmorphism overlay that fades/slides up on hover */
.bihome-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 64, 105, 0.06); /* Very subtle brand color tint */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none; /* Let clicks pass to the card link */
    transition: opacity 0.3s ease;
}

.bihome-modal-color-item:hover .bihome-modal-overlay {
    opacity: 1;
}

.bihome-modal-overlay-btn {
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #0c4069;
    border: 1px solid rgba(12, 64, 105, 0.12);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(12, 64, 105, 0.08);
    transform: translateY(12px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bihome-modal-color-item:hover .bihome-modal-overlay-btn {
    transform: translateY(0);
    background: #0c4069;
    color: #fff;
    border-color: #0c4069;
}

/* Rowan and Horizon now display using native square images with the standard contains */

/* Tablet & Mobile responsive styles for Modal */
@media (max-width: 768px) {
    .bihome-colors-modal {
        padding: 12px;
    }
    .bihome-modal-content {
        max-height: 90vh;
        border-radius: 12px;
    }
    .bihome-modal-header {
        padding: 16px 20px;
    }
    .bihome-modal-title {
        font-size: 16px;
    }
    .bihome-modal-items {
        padding: 16px;
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
    .bihome-modal-color-item {
        border-radius: 8px;
    }
    .bihome-modal-img-wrapper img {
        padding: 8px;
    }

    /* Mobile-friendly: show the overlay button statically at the bottom of the card */
    .bihome-modal-overlay {
        opacity: 1;
        background: transparent;
        padding: 6px;
    }
    .bihome-modal-overlay-btn {
        transform: translateY(0);
        font-size: 9px;
        padding: 6px 8px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 6px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    }
}


