/*
=====================================================
  STYLES FOR THE NEW PRODUCTS MARKETPLACE PAGE
=====================================================
*/

.products-page-main {
    padding: 2rem 0;
}

.marketplace-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.marketplace-header h1 {
    font-size: clamp(2.2rem, 8vw, 3rem);
    font-weight: 800;
}

.marketplace-header p {
    font-size: clamp(1rem, 4vw, 1.1rem);
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0.5rem auto 0;
}

/* --- Filter Panel --- */
.filter-panel {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all var(--transition-speed);
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 20%, transparent);
}

/* Category Filter Buttons */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.category-btn {
    background-color: var(--secondary-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.category-btn:hover {
    background-color: var(--secondary-hover);
    border-color: var(--text-secondary);
}

.category-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Product Grid on this page */
.products-page-main .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0; /* Remove padding from grid itself */
}

.no-results {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

/* Responsive Breakpoints */
@media (min-width: 768px) {
    .filter-panel {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        align-items: flex-end;
    }

    .products-page-main .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .products-page-main .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/*
=====================================================
  CORRECTED STYLES FOR PERFECTLY ALIGNED BOTTOM NAV ICONS
=====================================================
*/

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    /* This is the key: it ensures everything is centered vertically */
    justify-content: center; 
    align-items: center;
    gap: 0.25rem;
    
    /* This makes sure each link takes up equal space */
    flex: 1; 
    
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
    padding: 0.25rem 0; /* Add some vertical padding */
}

.nav-icon-wrapper {
    width: 28px;
    height: 28px;
    display: flex; /* This is also key for centering the image inside */
    align-items: center;
    justify-content: center;
}

.nav-icon-wrapper img {
    max-width: 100%;
    max-height: 100%;
    transition: opacity 0.2s ease-in-out;
}

/* The rest of your existing hover and active styles are perfect and do not need to change */
[data-theme="dark"] .nav-icon-wrapper img {
    filter: grayscale(1) brightness(0.7) contrast(1.2);
}

.bottom-nav-link.active .nav-icon-wrapper img,
.bottom-nav-link:hover .nav-icon-wrapper img {
    opacity: 1;
    filter: none;
}

.bottom-nav-link.active span {
    color: var(--primary-color);
}

.bottom-nav-link:hover span {
    color: var(--text-primary);
}


/*
=====================================================
  NEW STYLES FOR PRODUCT CARD DISCOUNTS
=====================================================
*/

/* Ensure the wrapper is a positioning context for the badge */
.product-image-wrapper {
    position: relative;
}

/* Styles for the discount badge on the product card */
.discount-badge-card {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--red-color, #e53e3e);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: var(--border-radius-md);
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Container for stacked prices */
.price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

/* Slashed original price */
.original-price-card {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

/* Text for "Coming Soon" status */
.coming-soon-text {
    font-size: 1.1rem !important;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Ensure the main price doesn't have extra margin when stacked */
.price-container .product-price {
    margin-top: -2px;
}



/*
=====================================================
  DEFINITIVE COUPON TOAST NOTIFICATION (V2 - POLISHED)
=====================================================
*/
.coupon-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    max-width: 380px; /* Slightly wider */
    width: calc(100% - 3rem);
    z-index: 200;

    background: color-mix(in srgb, var(--surface-color) 85%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;

    transform: translateY(200%);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
    pointer-events: none;
}
.coupon-toast.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--secondary-hover);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toast-icon svg { width: 18px; height: 18px; }

.toast-content p {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
}
.toast-content p strong { font-weight: 700; color: var(--primary-color); }

.copy-coupon-btn-toast {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.copy-coupon-btn-toast:hover { background-color: var(--primary-hover); }

/* Animated checkmark for "Copied!" state */
@keyframes checkmark-in {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.copy-coupon-btn-toast .checkmark {
    animation: checkmark-in 0.3s ease-out;
}

.close-toast-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.close-toast-btn:hover { opacity: 1; }

/* Mobile adjustments */
@media (max-width: 480px) {
    .coupon-toast { left: 50%; transform: translateX(-50%) translateY(200%); }
    .coupon-toast.visible { transform: translateX(-50%) translateY(0); }
}