/* MAIN PRODUCT PAGE */

#product-details {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 50px;
    max-width: 1200px;
    margin: 30px auto 90px auto;
    padding: 40px 40px 0px 40px;
    border-radius: 30px 30px 0px 0px;
}

.product-info-holder {
    min-width: 300px;
    max-width: 650px;
    flex: 1;
    overflow: hidden;
    margin-bottom: 20px;
    margin-top: 30px;
}

/* 🛑 NEW: Layout for Quantity and Size Selectors */
#product-type-selector {
    display: flex;
    flex-direction: column; /* Stack size and quantity controls vertically */
    gap: 20px; /* Space between groups */
    margin-top: 30px;
    width: 100%; /* Take full width of parent */
    max-width: 400px;
}

.quantity-selector-group, 
.size-selector-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 🛑 NEW: Size Button Container */
#size-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 🛑 NEW: Size Button Style */
.size-option-btn {
    background-color: rgb(213 213 213);
    border: none;
    color: black;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    min-width: 50px;
    text-align: center;
}

/* 🛑 NEW: Selected Size Button Style */
.size-option-btn.selected {
    background-color: black;
    color: white;
    border-color: black;
}

#product-details p {
    word-break: break-word;
}

/* 🛑 NEW: Specific style for the main product description */
.product-description {
    margin-top: 15px; 
}


.main-product-image {
    width: 100%;              
    max-width: 400px;         
    aspect-ratio: 1 / 1;      
    object-fit: cover;        
    border-radius: 15px;
    min-width: 300px;   
    display: flex;    
    min-height: 450px;  
}

/* Apply the same fixed dimensions to the quantity input */
#product-details input.quantity-input-style {
    background-color: rgb(213 213 213);
    border: none;
    color: black;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    width: 100px;
}

/* Optional: Keep a permanent subtle glow while focused */
#product-details input:focus,
#product-details select:focus {
    outline: none;
}

#add-to-cart {
    background-color: #00432d;
    border: none;
    color: white;
    padding: 15px 30px; /* Increased padding for better vertical size match */
    border-radius: 15px;
    margin-left: 0; /* Remove horizontal margin */
    margin-top: 10px; /* Add space below selectors */
    font-size: 1em;
    width: 100%;
    max-width: 400px;
}

/* ---------------------------------------------------------------- */
/* 🟢 NEW: TAB STYLES (Details/Ratings) */
/* ---------------------------------------------------------------- */

/* Container for all tab content below the main product box */
#product-tab-content-wrapper {
    max-width: 1200px;
    margin: 0px auto;
    padding: 0px 40px 23px 0px;
    width: 100%;
    box-sizing: border-box;
    /* border-radius: 0px 0px 15px 15px; */
    /* background: rgb(243 243 243); */
    border-bottom: 1px solid #dddddd;
}

.tabs-header-wrapper {
    display: flex;
    padding: 39px 25px 0px 25px;
    max-width: 1200px;
    margin: 0px auto;
    /* background: rgb(243 243 243); */
    /* border-radius: 15px 15px 0px 0px; */
    border-top: 1px solid #cfcfcf;
}

.tab-header {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1.1em;
    color: #888;
    position: relative;
    transition: color 0.2s ease;
}

.tab-header:hover {
    color: #000;
}

.tab-header h2 {
    margin: 0;
    font-size: 1.2em;
}

.tab-header.active {
    color: black;
    font-weight: 600;
}

/* Indicator line for the active tab */
.tab-header.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: black;
}

.tab-content {
    padding: 33px 10px 34px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tab-content.hidden {
    display: none !important;
}

#product-content-section {
    background-color: white;
    max-width: 1125px;
    margin: 0px auto 55px auto;
    border-radius: 10px;
}

.center {
    margin: 0px 30px;
}

/* ---------------------------------------------------------------- */
/* 🟢 MODIFIED: Rating Section styles to fit tab content */
/* ---------------------------------------------------------------- */

/* #product-ratings is no longer the main container, it's now wrapped inside #ratings-tab-content */
/* The styles that defined the max-width and margin are moved to #product-tab-content-wrapper */

/* Rename this class for clarity/simplicity */
.product-ratings-border {
    border: none; /* Keep border: none to remove the border if it was used for separation */
    padding: 0; /* Remove padding as it's within a tab content wrapper */
    border-radius: 0; /* Remove border-radius */
    min-width: 300px;
    background-color: transparent; /* Transparent background */
}

/* This is the new container for the summary above the list */
.product-ratings-summary-container {
    padding-bottom: 15px;
    border-bottom: solid rgba(0, 0, 0, 0.192) 1px;
}

.product-rating-summary {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.product-rating-summary .average-rating {
    font-size: 2.5em;
    font-weight: 700;
    color: #333;
}

.product-ratings-title, 
.product-ratings-title div {
    /* These styles were for the old title area, mostly retired/simplified */
    display: none; 
}


/* Keep individual rating styles */
.product-rating {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.212);
}

.product-rating:last-child {
    border-bottom: none;
}

.product-rating-stars {
    margin-top: 18px;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: gold;
}

.product-rating-username {
    margin: 1px 0px 5px 0px;
    font-weight: 600;
}

.product-rating-date {
    font-size: 0.9em;
    color: #666;
}

#show-more-ratings {
    background-color: #D0D7CD;
    border: none;
    color: black;
    padding: 6px 8px;
    width: 100%; /* Make button full width in the tab area */
    border-radius: 15px;
    margin-top: 25px;
    font-size: 1em;
    cursor: pointer;
}

/* ---------------------------------------------------------------- */
/* GENERAL STYLES (Keep/Cleaned) */
/* ---------------------------------------------------------------- */

#products-title {
    max-width: 1200px;
    margin: 0px auto;
    padding: 16px 0px 14px 40px;
}

/* Cart & Report Messages */
.cart-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 9999;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease;
}

.cart-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.cart-message.hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}

.cart-message.success { background: #4caf50; }
.cart-message.error   { background: #f44336; }
.cart-message.info    { background: #2196f3; }

.product-title-with-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.product-main-h1 {
    width: 100%;
    word-break: break-word;
    white-space: normal;
    margin-top: 15px;
}

.menu-dots {
  cursor: pointer;
  font-size: 22px;
  color: #000000;
  padding: 4px 6px;
  border-radius: 50%;
  transition: background 0.2s;
  position: relative;
  z-index: 2;
}

.menu-dots:hover {
  background: #eee;
}

.menu-dropdown {
  position: absolute;
  top: 5px;
  right: 35px; 
  background: #f7f7f736; 
  border-radius: 8px;
  padding: 2px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 10;
  min-width: 130px;
  backdrop-filter: blur(8px);
}

.menu-dropdown button {
  width: 100%;
  background: #f7f7f7; 
  border: none;
  padding: 5px 10px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  color: #333;
  font-size: 14px;
  transition: background 0.2s ease;
}

.menu-dropdown button:hover {
  background: #e6e6e6;
}

.hidden {
  display: none;
}

.report-popup {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: #222;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  font-size: 14px;
}

.report-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.report-popup.success {
  background: #119c4b;
}

.report-popup.error {
  background: #e74c3c;
}

/* PRODUCT HOLDER */

.product-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 230px;
    height: 330px;
    padding: 23px;
}

.product-card img {
    display: flex;
    flex-direction: row;
    align-self: center;
    width: 190px;
    height: 190px;
    object-fit: cover;
    border-radius: 15px;
}

.product-card div {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
}

.product-price {
    align-self: flex-end;
    margin-top: 15px;
    font-weight: 700;
}

.product-name {
    font-weight: 700;
}

#products-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-template-rows: 335px;
    justify-items: center;
    max-width: 1200px;
    margin: 0px auto;
    justify-content: center;
    padding: 0px 40px;
}

.error-msg {
  margin-top: 80px;
}

/* Truncation Wrappers & Spacing Reset */
.product-name-wrapper,
.username-wrapper {
    width: 100%; 
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin: 0 !important; 
    padding: 0;
}

/* Inner Text Elements */
.product-name, 
.seller-username {
    display: block; 
    width: 100%;
    margin: 0; 
    padding: 0;
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
}

/* Size Chart Button */
.size-chart-btn {
    border: none;
    font-size: 1em;
    padding: 15px 0;
    border-radius: 15px;
    margin-top: 10px;
    width: 100%;
    max-width: 400px;
    background: rgb(217 217 217);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh; 
    margin: auto; 
}

.modal-image {
    display: block;
    max-width: 100%; 
    max-height: 90vh; 
    object-fit: contain; 
    border-radius: 8px; 
}

.close-btn {
    position: absolute;
    top: -30px; 
    right: -30px; 
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: transparent; 
    border: none;
    padding: 10px;
    z-index: 1001; 
}

/* Star Alignment */
.star-rating-container {
    display: flex;
    align-items: center;
    gap: 1px; /* Tight star spacing */
}

.star-icon {
    font-size: 20px !important; /* Adjust size as needed */
    color: #ccc; /* Default empty star color */
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.star-icon.filled {
    color: #FFB400; /* Rich gold color */
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Sales Count Divider */
.sales-count-text {
    font-size: 0.85rem;
    color: #666;
    margin-left: 8px;
    padding-left: 10px;
    border-left: 1px solid #ddd;
    line-height: 1;
}

.star-rating-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star-icon {
    font-size: 20px !important;
    /* Force all stars to be solid filled shapes */
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* The 'earned' stars (Gold) */
.star-icon.filled {
    color: #FFB400; 
}

/* The 'unearned' stars (Light Grey, but still solid) */
.star-icon.unearned {
    color: rgb(181 180 180); 
}

.sales-count-badge {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid #ddd;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.2;
}

.seller-mini-pfp {
    width: 23px;
    height: 23px;
    margin-right: 7px;
    border-radius: 30px;
}

.seller-badge-container {
    display: flex;
}

.product-stats-bar {
    display: flex;
    margin: 10px 0px;
}

.sales-count-badge {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid #ddd;
    color: #666;
    font-size: 1em;
    line-height: 1.2;
    margin-top: 2px;
}

.main-product-price {
    align-self: flex-end;
    margin-bottom: 5px;
    font-size: 60px;
    font-weight: 400;
}
/* ---------------------------------------------------------------- */
/* MEDIA QUERY FOR SMALL SCREENS (600px and under) */
/* ---------------------------------------------------------------- */
@media (max-width: 600px) {     
    #product-details {
        padding: 30px;
        flex-direction: column; /* Stack image and info vertically */
        margin: 20px auto 20px auto;
    }
    
    .product-info-holder {
        min-width: unset;
        width: 100%;
        margin: 0px;
    }

    .product-card img {
        width: 140px;
        height: 140px;
    }
    .product-card {
        width: 180px;
        height: 260px;
        padding: 10px 23px;
    }
    #products-section {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        grid-template-rows: 260px;
        gap: 10px;
        min-width: unset; /* Remove min-width restriction */
        padding: 0 20px;
    }

    #product-type-selector {
        max-width: 100%;
    }
    
    .close-btn {
        top: 0;
        right: 10px;
        color: #fff;
    }
    
    #product-tab-content-wrapper {
        padding: 0 20px;
    }
    .main-product-image {
        margin-top: 8px;
    }
}

