/* Product image container */
.product-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--surface-color);
}

    /* Product image */
    .product-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        cursor: pointer;
    }

/* Invisible clickable layer for details page */
.product-image-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    cursor: pointer;
}

/* Product card */
.product-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .product-box:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-md, 0 12px 28px rgba(0,0,0,0.12));
    }

.product-box-link {
    cursor: pointer;
}

/* Overlay */
.product-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.product-box:hover .product-overlay {
    opacity: 1;
}

/* Only real controls inside overlay should be clickable */
.product-overlay .product-quick-actions,
.product-overlay .quick-action-btn,
.product-overlay .add-to-cart-container,
.product-overlay .open-add-to-cart-modal {
    pointer-events: auto;
}

/* Keep quick actions positioned properly */
.product-quick-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}

/* Keep add to cart positioned properly */
.add-to-cart-container {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    justify-content: center;
}

/* Buttons */
.quick-action-btn,
.open-add-to-cart-modal {
    cursor: pointer;
}

/* Product content layout */
.product-content {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
    padding-top: 10px;
}

.product-details {
    height: auto;
    overflow: visible;
}

/* Product title */
.product-title {
    margin: 0 0 8px;
    height: auto;
    max-height: none;
    overflow: visible;
    white-space: normal;
    display: block;
    line-height: 1.35;
}

    .product-title a {
        display: block;
        line-height: 1.35;
        text-decoration: none;
        color: inherit;
        white-space: normal;
        overflow: visible;
    }

/* Product code */
.product-code {
    display: block;
    font-size: 12px;
    color: #777;
    margin-bottom: 2px;
    white-space: normal;
    overflow: visible;
}

/* Product name - full visible */
.product-name {
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

/* Product colors spacing */
.product-color-options {
    margin-top: 8px;
}

/* Size grid */
.size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-option {
    margin: 0;
}

    .size-option .form-check-input {
        position: absolute;
        opacity: 0;
    }

.size-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    min-width: 70px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    background: var(--surface-color, #fff);
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.size-option .form-check-input:checked + .size-chip {
    border-color: var(--bs-primary, #0d6efd);
    background: rgba(13, 110, 253, 0.08);
    color: var(--bs-primary, #0d6efd);
    font-weight: 600;
}

.size-chip:hover {
    border-color: var(--bs-primary, #0d6efd);
}

.size-count {
    margin-left: 4px;
    opacity: 0.7;
}


/* Force product title and name to wrap fully */
.product-content,
.product-details,
.product-title,
.product-title a,
.product-title .product-code,
.product-title .product-name {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    text-overflow: unset !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

/* Keep title as block and allow multiple lines */
.product-title {
    display: block !important;
    margin: 0 0 8px !important;
    line-height: 1.35 !important;
}

    .product-title a {
        display: block !important;
        line-height: 1.35 !important;
    }

/* Code on its own line */
.product-code {
    display: block !important;
    font-size: 12px;
    color: #777;
    margin-bottom: 4px;
}

/* Name on its own line and fully visible */
.product-name {
    display: block !important;
    line-height: 1.4 !important;
}

/* Keep card layout stable */
.product-box {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-content {
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}
