/* ========== BRAND COLORS ========== */
:root {
    --red-primary: #940909;
    --red-secondary: #BE3030;
    --red-tertiary: #BC3131;
    --red-light: #911616;
    --white: #FFFFFF;
    --gray-dark: #2c2c2c;
    --gray-medium: #666666;
    --gray-light: #f8f9fa;
    --border-color: #ddd;
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Back Button Styles */
.product-back-header {
    padding: 15px 0;
}

.btn-back {
    background: var(--red-primary);
    border: 2px solid var(--red-primary);
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 2px 8px rgba(148, 9, 9, 0.3);
}

.btn-back:hover {
    background: var(--red-secondary);
    border-color: var(--red-secondary);
    color: var(--white);
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(148, 9, 9, 0.4);
}

.btn-back:active {
    transform: translateX(-3px) scale(0.98);
}

.btn-back i {
    font-size: 0.9rem;
}

body {
    font-family: 'Montserrat', Arial, sans-serif;
    background-color: #f8f9fa;
}

/* ========== HEADER ========== */
.header {
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-secondary) 38%, var(--red-tertiary) 68%, var(--red-light) 100%);
    padding: 10px 0;
}

.header .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}

.search-box {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 8px 40px 8px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--red-primary);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.header-icons {
    display: flex;
    gap: 20px;
    color: white;
}

.header-icons i {
    font-size: 1.2rem;
    cursor: pointer;
}

/* ========== MAIN LAYOUT ========== */
.main-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 200px;
    background: linear-gradient(180deg, #495057 0%, #343a40 50%, #212529 100%);
    padding: 0;
    position: relative;
    min-height: calc(100vh - 60px);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    z-index: 1039;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.sidebar-content {
    padding: 20px 0;
    position: relative;
    z-index: 10;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.15);
    text-decoration: none;
    color: white;
    transform: translateX(5px);
}

.sidebar-item i {
    width: 20px;
    text-align: center;
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Legacy support for sidebar-menu structure */
.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.15);
    text-decoration: none;
    color: white;
    transform: translateX(5px);
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
    margin-right: 12px;
    font-size: 1.1rem;
}

/* ========== CONTENT ========== */
.content {
    flex: 1;
    padding: 20px;
}

/* ===== PRODUCT CONTENT STYLES ===== */
.product-content {
    padding: 30px;
    background-color: white;
    border-radius: 8px;
}

/* PRODUCT IMAGES SECTION */
.main-product-image {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
    cursor: pointer;
}

.product-main-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background-color: #e9ecef;
}

/* THUMBNAIL IMAGES */
.thumbnail-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    cursor: pointer;
}

.thumbnail-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thumbnail-img:hover {
    border-color: #c53030;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.thumbnail-img.active {
    border-color: #dc3545;
    border-width: 2px;
}

/* ===== PRODUCT INFORMATION STYLES ===== */

/* PRODUCT TITLE */
.product-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
}

/* PRODUCT RATING */
.product-rating {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}

.stars i {
    color: #ddd;
    margin-right: 2px;
    font-size: 16px;
}

.stars i.fas.fa-star {
    color: #ffc107 !important; /* Yellow/gold for filled stars */
}

.stars i.far.fa-star {
    color: #ddd !important; /* Gray for empty stars */
}

.stars i.fas.fa-star-half-alt {
    color: #ffc107 !important; /* Yellow/gold for half stars */
}

/* REVIEWS SECTION */
.reviews-content {
    padding: 20px 0;
}

.reviews-list {
    max-height: 600px;
    overflow-y: auto;
}

.review-item {
    padding: 15px 0;
}

.review-item:last-child {
    border-bottom: none !important;
}

.review-header {
    margin-bottom: 10px;
}

.review-header h6 {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.review-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.review-rating .fas.fa-star {
    color: #ffc107;
    font-size: 14px;
}

.review-rating .far.fa-star {
    color: #ddd;
    font-size: 14px;
}

.review-text {
    color: #666;
    line-height: 1.6;
    margin-top: 8px;
}

.review-item small {
    font-size: 12px;
}

.rating-text {
    color: #666;
    font-size: 14px;
}

/* PRODUCT PRICE */
.product-price {
    font-size: 24px;
    font-weight: bold;
    color: #b71c1c;
}

.product-price .price {
    color: #b71c1c;
}

/* SIZE OPTIONS SECTION */
.size-options {
    margin-bottom: 20px;
}

.size-option-btn {
    width: 100%;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.size-option-btn:hover {
    border-color: #b71c1c;
    background-color: #fff5f5;
}

.size-option-btn.active {
    border-color: #b71c1c;
    background-color: #b71c1c;
    color: white;
}

.size-option-btn.active .size-text,
.size-option-btn.active .price-text,
.size-option-btn.active .stock-text {
    color: white;
}

.size-text {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.price-text {
    color: #b71c1c;
    font-weight: 600;
    font-size: 14px;
}

.stock-text {
    color: #666;
    font-size: 12px;
}

/* LENGTH OPTIONS SECTION */
.length-options {
    margin-bottom: 20px;
}

.option-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-family: 'Montserrat', sans-serif;
}

.length-buttons {
    display: flex;
    gap: 10px;
}

/* LENGTH BUTTONS */
.length-btn {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.length-btn:hover {
    border-color: #b71c1c;
    background-color: #fff5f5;
}

.length-btn.active {
    background-color: #b71c1c;
    color: white;
    border-color: #b71c1c;
}

/* QUANTITY SECTION */
.quantity-section {
    margin-bottom: 20px;
}

/* QUANTITY DROPDOWN */
.quantity-dropdown-container {
    margin-top: 10px;
}

.quantity-dropdown {
    width: 100%;
    max-width: 300px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.quantity-dropdown:hover {
    border-color: #b71c1c;
}

.quantity-dropdown:focus {
    outline: none;
    border-color: #b71c1c;
    box-shadow: 0 0 5px rgba(183, 28, 28, 0.2);
}

.quantity-dropdown option:disabled {
    color: #999;
    font-style: italic;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* QUANTITY BUTTONS */
.quantity-btn {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.quantity-btn:hover {
    border-color: #b71c1c;
    background-color: #fff5f5;
}

/* QUANTITY INPUT FIELD */
.quantity-input {
    width: 80px;
    height: 35px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.quantity-input:focus {
    outline: none;
    border-color: #b71c1c;
    box-shadow: 0 0 5px rgba(183, 28, 28, 0.2);
}

.stock-info {
    margin-top: 8px;
}

.stock-available {
    color: #666;
    font-size: 14px;
}

.add-to-cart-btn.add-to-cart-disabled,
a.add-to-cart-btn.add-to-cart-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #e0e0e0 !important;
    color: #999 !important;
}

/* SMART QUANTITY SUGGESTIONS */
.smart-quantity-suggestions {
    margin-top: 15px;
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
}

.suggestions-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.suggestions-header i {
    color: #ffc107;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-item {
    width: 100%;
}

.suggestion-btn {
    width: 100%;
    padding: 10px 15px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-btn:hover {
    border-color: #b71c1c;
    background-color: #fff5f5;
    transform: translateX(3px);
}

.suggestion-qty {
    font-weight: 600;
    color: #b71c1c;
    font-size: 14px;
}

.suggestion-reason {
    font-size: 12px;
    color: #666;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 15px;
}

/* ADD TO CART BUTTON */
.btn-add-cart {
    background-color: #b71c1c;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    flex: 1;
    max-width: 200px;
}

.btn-add-cart:hover {
    background-color: #8f1414;
    color: white;
}

/* BUY NOW BUTTON */
.btn-buy-now {
    background-color: white;
    color: #b71c1c;
    border: 2px solid #b71c1c;
    padding: 10px 30px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    max-width: 200px;
}

.btn-buy-now:hover {
    background-color: #b71c1c;
    color: white;
}

/* ===== PRODUCT TABS SECTION ===== */
.product-tabs-container {
    margin-top: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
}

/* CUSTOM TABS STYLING */
.custom-tabs {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0;
}

.custom-tabs .nav-item {
    margin-bottom: 0;
}

/* TAB NAVIGATION LINKS */
.custom-tabs .nav-link {
    border: none;
    border-right: 1px solid #ddd;
    border-radius: 0;
    color: #666;
    font-weight: 500;
    padding: 12px 25px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: transparent;
}

.custom-tabs .nav-item:last-child .nav-link {
    border-right: none;
}

.custom-tabs .nav-link:hover {
    border-color: transparent;
    color: #333;
    background-color: #e9ecef;
}

.custom-tabs .nav-link.active {
    background-color: white;
    border-color: transparent;
    color: #333;
    font-weight: 600;
}

/* TAB CONTENT CONTAINER */
.tab-content-container {
    background-color: white;
}

/* TAB CONTENT */
.tab-content {
    padding: 25px;
}

/* DESCRIPTION CONTENT */
.description-content {
    line-height: 1.6;
    color: #333;
    font-size: 14px;
}

.description-content h5 {
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
}

.description-content h6 {
    color: #333;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 14px;
}

.description-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.description-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
    padding-left: 0;
}

.description-content li {
    margin-bottom: 3px;
    list-style-type: disc;
}

/* ===== RESPONSIVE DESIGN ===== */
/* Mobile: Sidebar as drawer */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        width: 250px;
        height: 100vh;
        z-index: 1040;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        min-height: 100vh;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
}

@media (min-width: 992px) {
    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .main-container {
        flex-direction: column;
    }
    
    /* Header layout without search bar */
    .header .container-fluid {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 15px;
    }
    
    .header .logo {
        flex-shrink: 0;
        order: 1;
    }
    
    .header .logo img {
        height: 32px;
        max-width: 100px;
    }
    
    .header .header-icons {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        order: 2;
        margin-left: auto;
    }
    
    .header .header-icons a,
    .header .header-icons button {
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.15rem;
        padding: 8px;
    }
    
    /* Mobile: Sidebar as drawer */
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        width: 250px;
        height: 100vh;
        z-index: 1040;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        min-height: 100vh;
        order: 0;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
    
    .content {
        order: 1;
        width: 100%;
    }
    
    .product-content {
        padding: 15px;
    }
    
    /* Product images and info stack on mobile */
    .product-content .row > [class*="col-"] {
        margin-bottom: 20px;
    }
    
    .main-product-image {
        margin-bottom: 15px;
    }
    
    .thumbnail-images {
        margin-top: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-add-cart,
    .btn-buy-now {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .quantity-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .length-buttons {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .header .container-fluid {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .header-icons {
        gap: 8px;
        margin-left: auto;
    }
    
    /* Tabs responsive */
    .custom-tabs {
        flex-wrap: wrap;
    }
    
    .custom-tabs .nav-link {
        padding: 10px 15px;
        font-size: 0.85rem;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .custom-tabs .nav-item:last-child .nav-link {
        border-bottom: none;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .description-content {
        font-size: 0.9rem;
    }
    
    .product-title {
        font-size: 1.3rem;
    }
    
    .product-price .price {
        font-size: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .product-content {
        padding: 10px;
    }
    
    .product-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .product-price .price {
        font-size: 1.3rem;
    }
    
    .quantity-section,
    .size-options,
    .length-options {
        margin-bottom: 20px;
    }
    
    .option-label {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .custom-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .tab-content {
        padding: 12px;
    }
    
    .description-content {
        font-size: 0.85rem;
    }
    
    .description-content h5 {
        font-size: 1rem;
    }
    
    .description-content h6 {
        font-size: 0.9rem;
    }
}

@media (max-width: 575.98px) {
    .header {
        padding: 8px 0;
    }
    
    .logo img {
        height: 35px;
    }
    
    .header-icons {
        gap: 12px;
    }
    
    .header-icons i {
        font-size: 1rem;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-price .price {
        font-size: 1.2rem;
    }
    
    .btn-add-cart,
    .btn-buy-now {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .quantity-input {
        width: 80px;
        font-size: 0.9rem;
    }
    
    .quantity-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}