html, body {
    margin: 0;
    font-family: 'Lato', sans-serif;
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
}

* {
    font-family: 'Lato', sans-serif;
}

/* Loader Styles */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
    min-height: 300px;
}

.loader {
    width: 60px;
    height: 60px;
    position: relative;
    margin-bottom: 25px;
}

.loader::before,
.loader::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: rgb(3, 122, 122);
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader::before {
    width: 60px;
    height: 60px;
    border-width: 4px;
    border-top-color: rgb(3, 122, 122);
    border-right-color: rgba(3, 122, 122, 0.3);
}

.loader::after {
    width: 40px;
    height: 40px;
    top: 10px;
    left: 10px;
    border-width: 3px;
    border-top-color: rgb(3, 122, 122);
    border-right-color: rgba(3, 122, 122, 0.5);
    animation-direction: reverse;
    animation-duration: 0.8s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-container p {
    color: rgb(3, 122, 122);
    font-size: 16px;
    font-weight: 500;
    margin-top: 15px;
    letter-spacing: 0.5px;
}

/* Error Message Styles */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    grid-column: 1 / -1;
    background-color: #fff5f5;
    border: 2px solid #feb2b2;
    border-radius: 10px;
    margin: 20px 0;
}

.error-message i {
    font-size: 48px;
    color: #e53e3e;
    margin-bottom: 15px;
}

.error-message p {
    color: #c53030;
    font-size: 16px;
    margin-bottom: 20px;
}

.error-message button {
    padding: 10px 20px;
    background-color: rgb(3, 122, 122);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.error-message button:hover {
    background-color: rgb(3, 94, 94);
}

/* Product Box Animation */
.product-box {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-box:hover {
    transform: translateY(-5px);
}

/* Product Skeleton Loader */
.product-skeleton {
    pointer-events: none;
    user-select: none;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 10px 10px 0 0;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-badge-top {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 70px;
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-name {
    padding: 15px 15px 5px 15px;
}

.skeleton-title {
    width: 80%;
    height: 18px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s infinite;
    margin-bottom: 8px;
}

.skeleton-brand {
    width: 60%;
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s infinite;
    margin-top: 5px;
}

.skeleton-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 15px 0;
    padding: 0 15px;
}

.skeleton-star {
    width: 18px;
    height: 18px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-rating-number {
    width: 35px;
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s infinite;
    margin-left: 8px;
}

.skeleton-price-quantity {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    width: 100%;
    box-sizing: border-box;
}

.skeleton-price {
    width: 100px;
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.skeleton-qty-btn {
    width: 28px;
    height: 28px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-qty-value {
    width: 30px;
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-button {
    width: 100%;
    height: 40px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 5px;
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Product Badges - Top Right */
.product-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.badge.hot-sale {
    background-color: #e53e3e;
}

.badge.new-arrival {
    background-color: #38a169;
}

/* New Arrival Badge - Updated Styling */
.badge-new {
    background: #4ecdc4;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.badge.best-seller {
    background-color: #d69e2e;
}

/* Price Container */
.price-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.price-container h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 10px;
    font-weight: normal;
}

.final-price {
    color: rgb(3, 122, 122);
    font-weight: bold;
    font-size: 18px;
}

.discount-badge {
    background-color: #e53e3e;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
}

/* Small price styles for product listing */
.product-price-small {
    font-size: 0.9em;
}

.original-price-small {
    text-decoration: line-through;
    color: #999;
    font-size: 0.8em;
    font-weight: normal;
    margin-right: 5px;
}

.final-price-small {
    color: rgb(3, 122, 122);
    font-weight: bold;
    font-size: 0.9em;
}

/* Discount badge on image top right */
.badge.discount-badge-top {
    background-color: #e53e3e;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.product-box {
    position: relative;
}
/* Main Container - Dark Theme E-commerce Design (Same as productReviewsSection) */
#mainContainer {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding-top: 60px; /* Reduced spacing - Account for fixed header */
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* Adjust padding when flash sale banner is visible */
body:has(.flash-sale-banner[style*="display: block"]) #mainContainer {
    padding-top: 110px; /* Reduced spacing - Extra padding when banner is visible */
}

#mainContainer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(3, 122, 122, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(3, 122, 122, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#mainContainer > section {
    position: relative;
    z-index: 1;
}

#mainContainer > section:last-child {
    margin-bottom: 0;
}

h1
{
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px; /* Reduced spacing */
    letter-spacing: 2px;
    font-weight: 700;
    text-transform: capitalize;
    color: #ffffff;
    box-sizing: border-box;
}

/* Align h2 headings with product containers - Dark Theme */
section > h2 {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px 20px; /* Reduced spacing */
    letter-spacing: 2px;
    font-weight: 900;
    text-transform: uppercase;
    box-sizing: border-box;
    color: #ffffff;
    font-size: 36px;
    position: relative;
    text-align: center;
}

section > h2::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgb(3, 122, 122), transparent);
    border-radius: 2px;
}

/* Remove accent line from h2 elements inside product cards */
#box h2,
.box h2,
.price-quantity-row h2,
.product-price-display {
    position: static;
}

#box h2::after,
.box h2::after,
.price-quantity-row h2::after,
.product-price-display::after {
    display: none !important;
    content: none !important;
}

#containerClothing, #containerAccessories
{
    display: grid;
    grid-gap: 30px;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    align-items: start;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}
#box,
.box
{
    width: 100%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    align-content: center;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(42, 42, 42, 0.8) !important;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

#box::before,
.box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, rgb(3, 122, 122), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

#box:hover,
.box:hover {
    border-color: rgba(3, 122, 122, 0.5) !important;
    box-shadow: 0 8px 30px rgba(3, 122, 122, 0.2),
                0 4px 20px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-8px);
}

#box:hover::before,
.box:hover::before {
    opacity: 1;
}
#containerClothing img,
#containerAccessories img,
.box img,
#box img
{
    width: 100% !important;
    height: 300px !important;
    object-fit: cover !important;
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    border: none;
    display: block !important;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
    background: linear-gradient(135deg, #1a1a1a, #0f0f0f);
    transition: transform 0.3s ease;
}

#box:hover img,
.box:hover img {
    transform: scale(1.05);
}
#details
{
    padding: 20px;
    text-transform: capitalize;
    display: flex;
    flex-direction: column;
    background: transparent;
    position: relative;
    z-index: 2;
}
#box a,
.box a
{
    text-decoration: none;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 0;
    flex: 1;
    transition: color 0.3s ease;
    min-height: 0;
}

#box a:hover,
.box a:hover {
    color: rgb(3, 122, 122);
}

#box a > div:first-child,
.box a > div:first-child
{
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
    position: relative;
    flex-shrink: 0;
}

.product-brand {
    flex-shrink: 0;
}

#box a > div:first-child img,
.box a > div:first-child img
{
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

#box h3,
.box h3
{
    padding-left: 20px;
    padding-right: 20px;
    flex-shrink: 0;
}

#box .product-rating-details,
.box .product-rating-details
{
    padding-left: 20px;
    padding-right: 20px;
    flex-shrink: 0;
}

#box .price-quantity-row,
.box .price-quantity-row
{
    padding-left: 20px;
    padding-right: 20px;
    flex-shrink: 0;
}

.action-container {
    padding: 20px;
    margin-top: auto;
    background: rgba(15, 15, 15, 0.5);
    border-top: 1px solid rgba(42, 42, 42, 0.8);
    position: relative;
    z-index: 2;
}

/* Ensure action container is outside the link and clickable */
.product-actions {
    position: relative;
    z-index: 10;
}
#box h3,
.box h3
{
    font-size: 17px;
    margin: 10px 0 8px 0;
    padding: 0;
    font-weight: 600;
    padding-left: 20px;
    padding-right: 20px;
    color: #ffffff;
    line-height: 1.4;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    /* Limit to 3 lines with truncation */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.4em * 3); /* 3 lines based on line-height */
    word-wrap: break-word;
}
h4
{
    font-weight: 100;
    margin: 0;
}
h2
{
    color: #ffffff;
}

/* Product Rating Stars - Same as contentdetails page */
.product-rating-details {
    display: flex !important;
    align-items: center;
    gap: 6px;
    margin: 10px 0 15px 0;
    visibility: visible;
    opacity: 1;
}

.product-rating-details i {
    color: #ffc107;
    font-size: 18px;
}

.product-rating-details i.far {
    color: #ddd;
}

.product-rating-details .rating-number-details {
    color: #b0b0b0;
    font-size: 16px;
    margin-left: 8px;
    font-weight: 500;
    display: inline-block;
    visibility: visible;
}

/* Keep old class for backward compatibility */
.product-rating {
    display: flex !important;
    align-items: center;
    gap: 5px;
    margin: 8px 0;
    visibility: visible;
    opacity: 1;
}

.product-rating i {
    color: #ffc107;
    font-size: 14px;
}

.product-rating i.far {
    color: #ddd;
}

.product-rating .rating-number {
    color: #b0b0b0;
    font-size: 13px;
    margin-left: 5px;
    font-weight: 500;
    display: inline-block;
    visibility: visible;
}

/* Override h2 in price-quantity-row - allow flex for price display */
.price-quantity-row h2.product-price-display {
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1;
    min-width: 0;
}

.price-quantity-row h2:not(.product-price-display) {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Price and Quantity Row */
.price-quantity-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    gap: 15px;
    margin-top: auto;
}

.price-quantity-row .price-container {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.price-quantity-row .price-container h2 {
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
    line-height: 1.2;
}

.price-quantity-row .product-price-small {
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
}

.price-quantity-row .quantity-controls-index {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    white-space: nowrap;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    min-width: fit-content;
}

/* Product Actions (Quantity Controls & Add to Cart) */
.product-actions {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quantity-controls-index {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn-index {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(42, 42, 42, 0.8);
    background: linear-gradient(135deg, #1a1a1a, #0f0f0f);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
    color: #b0b0b0;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    flex-shrink: 0;
    box-sizing: border-box;
}

.quantity-btn-index:hover:not(:disabled) {
    background: linear-gradient(135deg, rgb(3, 122, 122), #4dd0e1);
    color: #fff;
    border-color: rgb(3, 122, 122);
    box-shadow: 0 2px 8px rgba(3, 122, 122, 0.4);
}

.quantity-btn-index:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-value-index {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
    flex-shrink: 0;
    box-sizing: border-box;
}

.btn-shop-now-index {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgb(3, 122, 122), #4dd0e1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(3, 122, 122, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-shop-now-index:hover:not(:disabled) {
    background: linear-gradient(135deg, #4dd0e1, rgb(3, 122, 122));
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(3, 122, 122, 0.6);
}

.btn-shop-now-index:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-shop-now-index i {
    font-size: 14px;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: #25d366;
    color: #fff;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.cart-notification i {
    font-size: 18px;
}

/* ----------------------------- MEDIA QUERY --------------------------- */

/* Desktop Large (1400px+) */
@media(min-width: 1400px) {
    #containerClothing, #containerAccessories {
        grid-template-columns: repeat(4, 1fr);
        grid-gap: 10px 10px;
    }
}

/* Desktop (1200px - 1399px) */
@media(max-width: 1399px) {
    #containerClothing, #containerAccessories {
        grid-template-columns: repeat(4, 1fr);
        grid-gap: 10px 10px;
    }
}

/* Tablet Landscape (1024px - 1199px) */
@media(max-width: 1199px) {
    h1 {
        font-size: 28px;
        padding: 40px 20px;
        width: 100%;
    }
    
    section > h2 {
        width: 100%;
        padding: 40px 20px 25px;
        font-size: 32px;
        color: #ffffff;
    }
    
    #containerClothing, #containerAccessories {
        grid-template-columns: repeat(4, 1fr);
        grid-gap: 50px 15px;
        width: 100%;
        padding: 0 20px 60px;
    }
}

/* Tablet Portrait (768px - 1023px) */
@media(max-width: 1023px) {
    #mainContainer {
        padding: 60px 0 50px; /* Reduced spacing - Maintain header offset */
    }
    
    body:has(.flash-sale-banner[style*="display: block"]) #mainContainer {
        padding-top: 110px; /* Reduced spacing */
    }
    
    h1 {
        font-size: 25px;
        padding: 25px 20px; /* Reduced spacing */
        width: 100%;
        color: #ffffff;
    }
    
    section > h2 {
        width: 100%;
        padding: 25px 20px 15px; /* Reduced spacing */
        font-size: 28px;
        color: #ffffff;
    }
    
    #containerClothing, #containerAccessories {
        grid-template-columns: repeat(3, 1fr);
        grid-gap: 10px 10px;
        width: 100%;
        padding: 0 20px 60px;
    }
}

/* Mobile Landscape (600px - 767px) */
@media(max-width: 767px) {
    #mainContainer {
        padding: 60px 0 40px; /* Reduced spacing - Maintain header offset */
    }
    
    body:has(.flash-sale-banner[style*="display: block"]) #mainContainer {
        padding-top: 110px; /* Reduced spacing */
    }
    
    #mainContainer > section {
        margin-bottom: 60px;
    }
    
    h1 {
        font-size: 22px;
        padding: 30px 20px;
        width: 100%;
        color: #ffffff;
    }
    
    section > h2 {
        width: 100%;
        padding: 30px 20px 20px;
        font-size: 24px;
        color: #ffffff;
    }
    
    section > h2::after {
        display: none;
    }
    
    #containerClothing, #containerAccessories {
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 10px 10px;
        width: 100%;
        padding: 0 20px 30px;
    }
    
    #box {
        border-radius: 8px;
    }
    
    #details {
        padding: 0 12px;
    }
    
    h3 {
        font-size: 15px;
        /* Ensure truncation works on mobile */
        max-height: calc(1.4em * 3);
    }
    
    h4 {
        font-size: 13px;
    }
    
    h2 {
        font-size: 16px;
    }
    
    .product-actions {
        padding: 12px;
        gap: 10px;
    }
    
    .quantity-controls-index {
        gap: 8px;
    }
    
    .quantity-btn-index {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .quantity-value-index {
        font-size: 14px;
    }
    
    .btn-shop-now-index {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .cart-notification {
        top: 80px;
        right: 10px;
        left: 10px;
        padding: 12px 15px;
        font-size: 13px;
    }
    
    /* Add padding to price-quantity-row on mobile (matches #details padding) */
    .price-quantity-row {
        padding: 10px 12px 15px 12px !important;
    }
}

/* Mobile Portrait (480px - 599px) */
@media(max-width: 599px) {
    #mainContainer {
        padding: 60px 0 35px; /* Reduced spacing - Maintain header offset */
    }
    
    body:has(.flash-sale-banner[style*="display: block"]) #mainContainer {
        padding-top: 110px; /* Reduced spacing */
    }
    
    #mainContainer > section {
        margin-bottom: 50px;
    }
    
    h1 {
        font-size: 20px;
        padding: 25px 20px;
        width: 100%;
        color: #ffffff;
    }
    
    section > h2 {
        width: 100%;
        padding: 25px 20px 20px;
        font-size: 22px;
        color: #ffffff;
    }
    
    #containerClothing, #containerAccessories {
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 25px 10px;
        width: 100%;
        padding: 0 20px 25px;
    }
    
    #details {
        padding: 0 10px;
    }
    
    h3 {
        font-size: 14px;
        /* Ensure truncation works on mobile */
        max-height: calc(1.4em * 3);
    }
    
    h4 {
        font-size: 12px;
    }
    
    h2 {
        font-size: 15px;
    }
    
    .product-actions {
        padding: 10px;
        gap: 8px;
    }
    
    .quantity-label-index {
        font-size: 12px;
    }
    
    .quantity-btn-index {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
    
    .quantity-value-index {
        font-size: 13px;
        min-width: 25px;
    }
    
    .btn-shop-now-index {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .cart-notification {
        top: 70px;
        right: 10px;
        left: 10px;
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .loader-container {
        padding: 40px 20px;
    }
    
    .error-message {
        padding: 30px 20px;
        margin: 15px 0;
    }
    
    /* Add padding to price-quantity-row on mobile (matches #details padding) */
    .price-quantity-row {
        padding: 10px 10px 12px 10px !important;
    }
}

/* Small Mobile (320px - 479px) */
@media(max-width: 479px) {
    #mainContainer {
        padding: 60px 0 30px; /* Reduced spacing - Maintain header offset */
    }
    
    body:has(.flash-sale-banner[style*="display: block"]) #mainContainer {
        padding-top: 110px; /* Reduced spacing */
    }
    
    #mainContainer > section {
        margin-bottom: 40px;
    }
    
    h1 {
        font-size: 18px;
        padding: 20px 20px;
        width: 100%;
        letter-spacing: 1px;
        color: #ffffff;
    }
    
    section > h2 {
        width: 100%;
        padding: 20px 20px 15px;
        font-size: 20px;
        letter-spacing: 1px;
        color: #ffffff;
    }
    
    #containerClothing, #containerAccessories {
        grid-template-columns: 1fr;
        grid-gap: 20px;
        width: 100%;
        padding: 0 20px 20px;
    }
    
    #box {
        border-radius: 8px;
    }
    
    #details {
        padding: 0 12px 12px;
    }
    
    h3 {
        font-size: 14px;
        /* Ensure truncation works on mobile */
        max-height: calc(1.4em * 3);
    }
    
    h4 {
        font-size: 12px;
    }
    
    h2 {
        font-size: 14px;
    }
    
    .product-actions {
        padding: 0px 10px 10px 10px;
        gap: 8px;
    }
    .price-quantity-row {
        padding: 5px 12px 10px 12px !important;
    }
    
    .quantity-label-index {
        font-size: 11px;
    }
    
    .quantity-btn-index {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }
    
    .quantity-value-index {
        font-size: 12px;
        min-width: 22px;
    }
    
    .btn-shop-now-index {
        padding: 12px 10px;
        font-size: 11px;
    }
    
    .cart-notification {
        top: 60px;
        right: 8px;
        left: 8px;
        padding: 10px;
        font-size: 11px;
    }
    
    .loader-container {
        padding: 30px 10px;
    }
    
    .loader {
        width: 50px;
        height: 50px;
    }
    
    .loader::before {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }
    
    .loader::after {
        width: 35px;
        height: 35px;
        top: 7.5px;
        left: 7.5px;
        border-width: 2.5px;
    }
    
    .error-message {
        padding: 25px 12px;
        margin: 12px 0;
    }
    
    .error-message i {
        font-size: 40px;
    }
    
    .error-message p {
        font-size: 14px;
    }
}

/* Smooth transitions for product cards - merged with main #box definition above */

/* Image loading animation */
#box img {
    transition: opacity 0.3s ease;
}

#box img[src=""] {
    opacity: 0;
}