/* Container for the main product image */
.img-big-wrap {
    width: 100%;
    height: 450px; /* Forces a consistent height for all products */
    display: flex;
    justify-content: center; /* Centers image horizontally */
    align-items: center;    /* Centers image vertically */
    overflow: hidden;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}

/* Ensures the main image doesn't stretch or squash */
.img-big-wrap img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Keeps original aspect ratio within the box */
}

/* Centered Thumbnail Gallery */
ul.thumb {
    margin: 20px auto;
    padding: 0;
    display: flex;
    justify-content: center; /* Centers the list of thumbnails */
    flex-wrap: wrap;
    list-style: none;
    float: none !important; /* Overrides previous float:left */
}

ul.thumb li {
    margin: 8px;
}

/* Uniform size for every thumbnail image */
ul.thumb li img {
    width: 110px;  /* Fixed width for uniformity */
    height: 110px; /* Fixed height for uniformity */
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    object-fit: cover; /* Crops image to fill the 110x110 square perfectly */
    transition: 0.3s;
}

/* Hover effect for better UI */
ul.thumb li img:hover {
    border: 1px solid #3167eb;
    transform: scale(1.05);
}

/* Push the whole page down so it starts below the fixed navbar */
body {
    /* 40px (top bar) + ~90px (main navbar height) = 130px */
    padding-top: 130px !important; 
}

/* 1. Large Product Image Box */
.card-product-grid .img-wrap {
    height: 320px; /* Increased height for a more prominent image */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #fff;
}

.card-product-grid .img-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    padding: 15px; /* Adds nice spacing around the product */
}

/* 2. Product Title - Visible and clean */
.card-product-grid .title {
    display: block !important;
    color: #212529 !important;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    min-height: 3em; /* Reserves space for 2 lines of text */
    margin: 10px 0;
    text-align: center;
    overflow: visible !important;
}

/* 3. Bottom Section - Always shows Price and Button */
.card-product-grid .info-wrap {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    min-height: 170px; /* Enough height for price and Add to Cart button */
    height: auto !important; 
    background-color: #fff;
    border-top: 1px solid #eee;
}

/* Forces the button to the very bottom */
.card-product-grid .mt-3 {
    margin-top: auto !important;
}

/* ==========================================================================
   GLOBAL BRAND COLOR THEME: #481616 (Deep Burgundy) & #fafafa (Off-White)
   ========================================================================== */

/* Solid / Action Buttons */
.btn-primary, 
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info,
.btn-dark,
.btn-add-go, 
.btn-add-store, 
.view-all-link, 
.btn-add-cart-link,
.btn-login,
.btn-create,
.btn-search-custom,
.btn-view-order,
.btn-return-order {
    background-color: #481616 !important;
    border-color: #481616 !important;
    color: #fafafa !important;
}

.btn-primary:hover, 
.btn-primary:focus,
.btn-primary:active,
.btn-secondary:hover,
.btn-success:hover,
.btn-danger:hover,
.btn-warning:hover,
.btn-info:hover,
.btn-dark:hover,
.btn-add-go:hover, 
.btn-add-store:hover, 
.view-all-link:hover,
.btn-add-cart-link:hover,
.btn-login:hover,
.btn-create:hover,
.btn-search-custom:hover,
.btn-view-order:hover,
.btn-return-order:hover {
    background-color: #350e0e !important;
    border-color: #350e0e !important;
    color: #fafafa !important;
    text-decoration: none !important;
}

/* Outline / Secondary / Light Buttons (e.g. Continue Shopping, Back, Cancel) */
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-dark,
.btn-outline-light,
.btn-light {
    background-color: #fafafa !important;
    border: 1px solid #481616 !important;
    color: #481616 !important;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover,
.btn-outline-warning:hover,
.btn-outline-info:hover,
.btn-outline-dark:hover,
.btn-outline-light:hover,
.btn-light:hover {
    background-color: #481616 !important;
    border-color: #481616 !important;
    color: #fafafa !important;
    text-decoration: none !important;
}

/* Alert Notifications */
.alert,
.alert-danger,
.alert-warning,
.alert-info,
.alert-success {
    background-color: #481616 !important;
    color: #fafafa !important;
    border: 1px solid #481616 !important;
    border-radius: 8px !important;
}

.alert .close,
.alert a,
.alert strong,
.alert span,
.alert p,
.alert i {
    color: #fafafa !important;
    opacity: 1 !important;
}

/* Stock Modal Styling */
#stockAlertModal .modal-header {
    background-color: #481616 !important;
    color: #fafafa !important;
}

#stockAlertModal .modal-content {
    background-color: #fafafa !important;
}

#stockAlertModal .modal-body,
#stockAlertModal .modal-body h6,
#stockAlertModal .modal-body i {
    color: #481616 !important;
}

#stockAlertModal .modal-footer .btn {
    background-color: #481616 !important;
    color: #fafafa !important;
    border: none !important;
}

.product-inline-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    padding: 10px 12px;
    background: #fff4f5;
    border: 1px solid #ead0d5;
    border-left: 4px solid #6d001f;
}

.product-inline-search input {
    width: min(420px, 70%);
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid #c9b0b5;
    border-radius: 3px;
}

.product-search-input-wrap {
    position: relative;
    width: min(420px, 70%);
}

.product-search-input-wrap input {
    width: 100%;
}

.product-search-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #c9b0b5;
    box-shadow: 0 4px 12px rgba(55, 0, 15, 0.18);
}

.product-search-result {
    display: grid !important;
    grid-template-columns: 1fr 2fr auto;
    width: 100%;
    gap: 8px;
    align-items: center;
    padding: 8px 10px !important;
    border: 0 !important;
    border-bottom: 1px solid #f0e2e4 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #32151c !important;
    text-align: left;
    font-weight: 400 !important;
}

.product-search-result:hover,
.product-search-result:focus {
    background: #fff1f3 !important;
}

.product-search-result strong {
    color: #6d001f;
}

.product-search-result span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-search-result em {
    color: #6b555a;
    font-size: 12px;
    font-style: normal;
    white-space: nowrap;
}

.product-inline-search button {
    min-height: 32px;
    padding: 6px 14px;
    border: 0;
    border-radius: 3px;
    background: #6d001f;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.product-inline-search button.clear-search {
    background: #8b6a70;
}

@media (max-width: 640px) {
    .product-inline-search {
        flex-wrap: wrap;
    }

    .product-inline-search input {
        width: 100%;
    }

    .product-search-input-wrap {
        width: 100%;
    }
}