/* ========== style.css - Shared styles for ACERO SHOP MPA ========== */

:root {
    --primary-color: #6f42c1;
    --secondary-color: #5a32a3;
    --accent-color: #0d6efd;
    --bg-light: #f8f9fa;
    --text-dark: #333;
    --bottom-nav-height: 70px;
}

* {
    user-select: text !important;
}

body { 
    font-family: 'Poppins', sans-serif; 
    background-color: var(--bg-light); 
    color: var(--text-dark);
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    margin: 0;
    overflow-x: hidden;
}

/* ========== EDGE-TO-EDGE PRODUCT GRID ON MOBILE ========== */
@media (max-width: 767px) {
    /* Only remove padding from main content containers, not navbar */
    main .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Keep navbar container padding */
    nav .container,
    .navbar .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .border-start.border-4 {
        margin-left: 0.75rem;
    }
}

@media (max-width: 480px) {
    /* Mobile spacing handled by product-card-col */
}

@media (min-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ========== NAVBAR ========== */
.navbar { 
    background-color: white; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); 
}

.navbar-brand {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* ========== HERO NOTIFICATION BELL ========== */
.hero-notif-bell {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 10;
}

.hero-notif-bell a {
    color: white;
    font-size: 1.4rem;
    position: relative;
    display: inline-block;
    padding: 8px;
    transition: transform 0.2s;
}

.hero-notif-bell a:hover {
    transform: scale(1.15);
    color: #fff;
}

/* ========== NOTIFICATION PAGE ITEMS ========== */
.notification-page-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: background 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: #333;
}

.notification-page-item:hover {
    background: #f9fafb;
}

.notification-page-item.unread {
    border-left: 4px solid var(--primary-color);
    background: #faf8ff;
}

.notification-page-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.notification-page-content {
    flex-grow: 1;
    min-width: 0;
}

.notification-page-message {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #333;
}

.notification-page-time {
    font-size: 0.7rem;
    color: #999;
    margin-top: 4px;
}

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: white;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.nav-item-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s, transform 0.3s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-item-bottom i { 
    font-size: 1.4rem; 
    margin-bottom: 4px;
    transition: transform 0.3s, color 0.3s;
}

/* ===== ACTIVE STATE ===== */
.nav-item-bottom.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item-bottom.active i {
    color: var(--primary-color);
}

/* Top indicator bar */
.nav-item-bottom.active::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 0 0 4px 4px;
    animation: slideDown 0.3s ease;
}

/* ===== CLICK BOUNCE ANIMATION ===== */
.nav-item-bottom.bounce i {
    animation: navBounce 0.4s ease;
}

@keyframes navBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== NOTIFICATION BADGE FOR BOTTOM NAV ===== */
.nav-item-bottom .notification-badge,
#nav-notifications .notification-badge {
    position: absolute !important;
    top: 0 !important;
    right: 8px !important;
    left: auto !important;
    transform: none !important;
    background: #e74c3c !important;
    color: white !important;
    font-size: 0.55rem !important;
    padding: 1px 4px !important;
    border-radius: 8px !important;
    min-width: 15px !important;
    text-align: center !important;
    z-index: 10 !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
}

/* Desktop bell badge */
#notifBellDesktop .notification-badge {
    position: absolute !important;
    top: -8px !important;
    right: -10px !important;
    left: auto !important;
    transform: none !important;
    background: #e74c3c !important;
    color: white !important;
    font-size: 0.6rem !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    min-width: 18px !important;
    text-align: center !important;
    z-index: 10 !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
}

/* Seller nav icon - locked state */
.nav-item-bottom.seller-locked {
    color: #999;
}

.nav-item-bottom.seller-locked i {
    position: relative;
}

.nav-item-bottom.seller-locked i::after {
    content: "\f023";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    bottom: -3px;
    right: -8px;
    font-size: 0.55rem;
    color: #e74c3c;
    background: white;
    border-radius: 50%;
    padding: 1px 2px;
}

/* Seller nav icon - unlocked/active state */
.nav-item-bottom.seller-unlocked {
    color: #00b894;
}

.nav-item-bottom.seller-unlocked i {
    position: relative;
}

.nav-item-bottom.seller-unlocked i::after {
    content: "\f058";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    bottom: -3px;
    right: -8px;
    font-size: 0.55rem;
    color: #00b894;
    background: white;
    border-radius: 50%;
    padding: 1px 2px;
}

/* Seller nav icon - pending state */
.nav-item-bottom.seller-pending {
    color: #f39c12;
}

.nav-item-bottom.seller-pending i {
    position: relative;
}

.nav-item-bottom.seller-pending i::after {
    content: "\f017";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    bottom: -3px;
    right: -8px;
    font-size: 0.5rem;
    color: #f39c12;
    background: white;
    border-radius: 50%;
    padding: 1px 2px;
}

/* Seller nav icon - expired/renew state */
.nav-item-bottom.seller-expired {
    color: #e74c3c;
}

.nav-item-bottom.seller-expired i {
    position: relative;
}

.nav-item-bottom.seller-expired i::after {
    content: "\f071";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    bottom: -3px;
    right: -8px;
    font-size: 0.5rem;
    color: #e74c3c;
    background: white;
    border-radius: 50%;
    padding: 1px 2px;
}

/* ========== HERO SECTION ========== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 80px 0;
    border-radius: 0 0 40px 40px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

/* ========== BUTTONS ========== */
.btn-primary-custom {
    background-color: var(--primary-color);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-primary-custom:hover { 
    background-color: var(--secondary-color); 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(111, 66, 193, 0.3);
    color: white;
}

.btn-success-custom {
    background-color: #00b894;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-success-custom:hover { 
    background-color: #00a381;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.3);
    color: white;
}

/* ========== PRODUCT CARDS ========== */
.product-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
    overflow: hidden;
    height: 100%;
    cursor: default;
    position: relative;
}

.product-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.08); 
}

.product-clickable { 
    cursor: pointer; 
}

/* Product images - responsive sizing */
.product-img {
    width: 100%;
    object-fit: cover;
    background-color: #f5f5f5;
    aspect-ratio: 1 / 1;
    border-radius: 12px 12px 0 0;
}

/* Product title */
.product-card h6 {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
    line-height: 1.35 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Product price */
.product-card .text-primary {
    font-size: 1rem;
    font-weight: 700;
}

/* Old price */
.product-card .text-decoration-line-through {
    font-size: 0.7rem;
    color: #999;
}

/* Card padding */
.product-card .p-2.pb-0 {
    padding: 8px 8px 4px 8px !important;
}

/* Add to Cart button */
.product-card .btn-outline-primary {
    padding: 6px 0;
    font-weight: 500;
    font-size: 0.75rem;
    border-radius: 8px;
}

.product-card .p-2.mt-auto {
    padding: 6px 8px 10px 8px !important;
}

/* ========== BADGES - REORGANIZED ========== */
/* Top-Left: Discount (top) + Badge Text (below) */
.badge-discount {
    position: absolute; 
    top: 8px; 
    left: 8px;
    background-color: #ff4757; 
    color: white;
    padding: 3px 8px; 
    border-radius: 12px;
    font-size: 0.65rem; 
    font-weight: 600;
    z-index: 2;
}

.badge-text {
    position: absolute; 
    top: 32px; 
    left: 8px;
    background-color: #2563eb; 
    color: white;
    padding: 3px 8px; 
    border-radius: 12px;
    font-size: 0.65rem; 
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Adjust badge-text position when discount is NOT present (only badge-text on left) */
.product-card .position-relative:not(:has(.badge-discount)) .badge-text,
.badge-text:first-of-type {
    top: 8px;
}

/* Top-Right: Tag only */
.badge-tag {
    position: absolute; 
    top: 8px; 
    right: 8px;
    background-color: #ffa502; 
    color: white;
    padding: 3px 8px; 
    border-radius: 12px;
    font-size: 0.65rem; 
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Mobile: slightly smaller badges to prevent overlap */
@media (max-width: 480px) {
    .badge-discount,
    .badge-tag,
    .badge-text {
        font-size: 0.6rem !important;
        padding: 2px 6px !important;
    }
    
    .badge-text {
        top: 28px;
    }
}

/* ========== CAROUSEL ARROWS - AUTO HIDE (FIXED) ========== */
/* Hide arrows by default */
.product-card .carousel-control-prev,
.product-card .carousel-control-next {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s ease, visibility 0.2s ease !important;
    width: 28px !important;
    height: 28px !important;
    background: rgba(0,0,0,0.5) !important;
    border-radius: 50% !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.product-card .carousel-control-prev {
    left: 5px !important;
}

.product-card .carousel-control-next {
    right: 5px !important;
}

.product-card .carousel-control-prev-icon,
.product-card .carousel-control-next-icon {
    width: 14px !important;
    height: 14px !important;
    background-size: 14px !important;
}

/* Show arrows on hover (desktop) */
.product-card:hover .carousel-control-prev,
.product-card:hover .carousel-control-next {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hide indicators by default, show on hover */
.product-card .carousel-indicators {
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
    margin-bottom: 5px !important;
}

.product-card:hover .carousel-indicators {
    opacity: 1 !important;
}

/* Mobile: slightly visible but not intrusive */
@media (max-width: 768px) {
    .product-card .carousel-control-prev,
    .product-card .carousel-control-next {
        opacity: 0.4 !important;
        visibility: visible !important;
        width: 32px !important;
        height: 32px !important;
    }
    
    .product-card .carousel-indicators {
        opacity: 0.3 !important;
    }
}

/* ========== CATEGORY PILLS ========== */
.category-scroll-container {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.category-scroll-container::-webkit-scrollbar { 
    display: none; 
}

.category-pill {
    display: inline-block;
    background: white; 
    border: 1px solid #eee; 
    padding: 8px 20px;
    border-radius: 50px; 
    cursor: pointer; 
    margin-right: 10px;
    transition: 0.3s; 
    font-weight: 500; 
    color: #666;
    font-size: 0.9rem;
}

.category-pill:hover, 
.category-pill.active {
    background-color: var(--primary-color); 
    color: white;
    border-color: var(--primary-color); 
    box-shadow: 0 4px 10px rgba(111, 66, 193, 0.2);
}

/* ========== SUPPORT WIDGET ========== */
.support-wrapper { 
    position: fixed; 
    bottom: 90px; 
    right: 20px; 
    z-index: 999; 
}

.main-support-btn {
    width: 55px; 
    height: 55px; 
    background: white; 
    border-radius: 50%;
    display: flex; 
    justify-content: center; 
    align-items: center;
    cursor: pointer; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    transition: transform 0.3s; 
    border: 2px solid #2563eb;
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.main-support-btn img { 
    width: 35px; 
}

.support-popup {
    position: absolute; 
    bottom: 70px; 
    right: 0; 
    width: 250px;
    background: #fff; 
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: none; 
    overflow: hidden; 
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.popup-header { 
    background: #2563eb; 
    color: #fff; 
    padding: 12px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.popup-header h4 { 
    margin: 0; 
    font-size: 15px; 
}

.close-popup { 
    background: none; 
    border: none; 
    color: #fff; 
    font-size: 20px; 
    cursor: pointer; 
}

.support-option { 
    display: flex; 
    align-items: center; 
    padding: 12px 15px; 
    text-decoration: none; 
    color: #333; 
    border-bottom: 1px solid #f0f0f0; 
    transition: background 0.2s; 
}

.support-option:hover { 
    background: #f9fafb; 
}

.support-option img { 
    width: 22px; 
    margin-right: 12px; 
}

/* ========== LOADER ========== */
#loader { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(255,255,255,0.95); 
    z-index: 9999; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    flex-direction: column;
}

/* ===== WAVE DOTS LOADING ===== */
.wave-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wave-dots span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: waveBounce 1.2s ease-in-out infinite;
}

.wave-dots span:nth-child(1) { animation-delay: 0s; background: var(--primary-color); }
.wave-dots span:nth-child(2) { animation-delay: 0.2s; background: #8b5cf6; }
.wave-dots span:nth-child(3) { animation-delay: 0.4s; background: #a78bfa; }

@keyframes waveBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-18px); opacity: 1; }
}

.loading-text {
    color: #999;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ========== COUPON CARD ========== */
.coupon-card { 
    background: white; 
    border-radius: 15px; 
    border: 1px dashed var(--primary-color); 
    position: relative; 
    overflow: hidden; 
}

/* ========== PAYMENT SUMMARY ========== */
.payment-summary-box { 
    background: #f0f2f5; 
    border-radius: 12px; 
    padding: 15px; 
    border: 1px solid #dcdcdc; 
    margin-bottom: 15px; 
}

/* ========== SELLER PAYMENT MODAL ========== */
.seller-payment-modal .payment-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.seller-payment-modal .payment-detail-row:last-child {
    border-bottom: none;
}

.seller-payment-modal .payment-detail-label {
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
}

.seller-payment-modal .payment-detail-value {
    font-weight: 700;
    color: #333;
    font-size: 0.85rem;
    word-break: break-all;
}

.seller-payment-modal .amount-highlight {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 700;
}

/* ========== SELLER HISTORY TABLE ========== */
.seller-history-table {
    font-size: 0.85rem;
}

.seller-history-table th {
    background: var(--bg-light);
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.8rem;
}

.seller-history-table td {
    vertical-align: middle;
    font-size: 0.8rem;
}

/* ========== GOOGLE TRANSLATE ========== */
#google_translate_element {
    min-width: 150px;
}

.goog-te-gadget-simple {
    background-color: transparent !important;
    border: none !important;
    padding: 5px 8px !important;
}

.goog-te-gadget-simple span,
.goog-te-menu-value span {
    color: var(--primary-color) !important;
}

.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

body {
    top: 0px !important;
}

.goog-logo-link {
    display: none !important;
}

.goog-te-gadget {
    color: transparent !important;
}

/* ========== FORM ELEMENTS ========== */
input, textarea, select {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* ========== MODALS ========== */
.modal-lg { 
    max-width: 90vw; 
}

.ratio-16x9 { 
    aspect-ratio: 16/9; 
}

/* ========== PROFILE AVATAR ========== */
#profileAvatarContainer {
    width: 100px; 
    height: 100px; 
    border-radius: 50%; 
    overflow: hidden; 
    margin: 0 auto; 
    cursor: pointer;
}

#profileAvatar {
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}

/* ========== LIST GROUP ========== */
.list-group-item {
    transition: 0.3s;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 768px) {
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-section h2 {
        font-size: 1.5rem;
    }
    
    .product-card h6 {
        font-size: 0.8rem !important;
    }
    
    .product-card .text-primary {
        font-size: 0.9rem;
    }
    
    .modal-fullscreen .modal-body {
        padding: 5px;
        height: calc(100vh - 85px);
    }
    .modal-fullscreen .modal-header {
        padding: 4px 10px;
        min-height: 38px;
    }
    .modal-fullscreen .modal-header h5 {
        font-size: 14px;
    }
    .modal-fullscreen .modal-footer {
        padding: 3px 10px;
        min-height: 35px;
    }
    .modal-fullscreen .modal-footer .btn {
        font-size: 11px;
        padding: 3px 15px;
    }
}

@media (max-width: 480px) {
    .product-card h6 {
        font-size: 0.75rem !important;
    }
    
    .product-card .text-primary {
        font-size: 0.85rem;
    }
    
    .product-card .btn-outline-primary {
        font-size: 0.7rem;
        padding: 4px 0;
    }
    
    .bottom-nav {
        height: 60px;
    }
    
    .nav-item-bottom {
        font-size: 0.65rem;
    }
    
    .nav-item-bottom i {
        font-size: 1.1rem;
    }
    
    .nav-item-bottom .notification-badge,
    #nav-notifications .notification-badge {
        top: -2px !important;
        right: 6px !important;
        font-size: 0.5rem !important;
        padding: 1px 3px !important;
        min-width: 14px !important;
    }
    
    .modal-fullscreen .modal-body {
        padding: 3px;
        height: calc(100vh - 75px);
    }
    .modal-fullscreen .modal-header {
        padding: 3px 8px;
        min-height: 32px;
    }
    .modal-fullscreen .modal-header h5 {
        font-size: 12px;
    }
    .modal-fullscreen .modal-footer {
        padding: 2px 8px;
        min-height: 30px;
    }
    .modal-fullscreen .modal-footer .btn {
        font-size: 10px;
        padding: 2px 12px;
    }
}

/* ========== UTILITY CLASSES ========== */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.border-start-4 {
    border-left-width: 4px !important;
}

.shadow-lg {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}

.rounded-4 {
    border-radius: 15px !important;
}

/* ========== SALE BADGE PULSE ANIMATION ========== */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ========== ENHANCED PRODUCT CARD STYLES ========== */
.product-card {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: auto !important;
    min-height: unset !important;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12) !important;
    border-color: rgba(0,184,148,0.2);
}
.product-card .product-img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px 12px 0 0;
}
.product-card:hover .product-img {
    transform: scale(1.05);
}

/* ========== SHOPEE-STYLE CARD LAYOUT (Left-to-Right, No Equal Heights) ========== */
.product-card {
    height: auto !important;
    min-height: unset !important;
}

/* Override Bootstrap row to not stretch items */
.row.g-3,
.row.g-3.mx-0,
.row.product-grid-uniform {
    align-items: flex-start !important;
}

/* View Details button pulse animation */
@keyframes viewDetailsPulse {
    0%, 100% { box-shadow: 0 3px 12px rgba(0,184,148,0.25); }
    50% { box-shadow: 0 3px 20px rgba(0,184,148,0.5); }
}
.view-details-btn {
    animation: viewDetailsPulse 2s ease-in-out infinite;
}

/* Add to Cart button card style */
.add-to-cart-btn-card {
    position: relative;
    overflow: hidden;
}
.add-to-cart-btn-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.add-to-cart-btn-card:hover::after {
    opacity: 1;
}

/* Badge discount glow */
.badge-discount {
    animation: badgeGlow 2s ease-in-out infinite;
}
@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 2px 8px rgba(231,76,60,0.3); }
    50% { box-shadow: 0 2px 16px rgba(231,76,60,0.5); }
}

/* ========== UNIFORM PRODUCT CARD SPACING (SHOPEE/TEMU STYLE) ========== */
.product-card-col {
    width: 50% !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
    margin-bottom: 6px !important;
    flex-shrink: 0;
}

@media (min-width: 576px) {
    .product-card-col {
        width: 33.333% !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
        margin-bottom: 6px !important;
    }
}

@media (min-width: 768px) {
    .product-card-col {
        width: 25% !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
        margin-bottom: 8px !important;
    }
}

@media (min-width: 992px) {
    .product-card-col {
        width: 20% !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
        margin-bottom: 8px !important;
    }
}

@media (min-width: 1200px) {
    .product-card-col {
        width: 16.666% !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        margin-bottom: 10px !important;
    }
}

/* ========== UNIFORM PRODUCT GRID SPACING (ALL PAGES) ========== */
/* Override Bootstrap row gutters - set to zero, we handle spacing via product-card-col */
.row.g-3,
.row.g-3.mx-0,
.row.product-grid-uniform,
#latestProductsContainer.row,
#shopProductsContainer.row,
#searchResultsContainer.row,
#exploreInterestsContainer.row,
#taggedSections .row {
    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
    margin-left: -3px !important;
    margin-right: -3px !important;
}

/* Remove Bootstrap column padding from all product grid columns */
.row.g-3 > [class*="col-"],
.row.g-3.mx-0 > [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0 !important;
}

@media (min-width: 768px) {
    .row.g-3,
    .row.g-3.mx-0,
    .row.product-grid-uniform,
    #latestProductsContainer.row,
    #shopProductsContainer.row,
    #searchResultsContainer.row,
    #exploreInterestsContainer.row,
    #taggedSections .row {
        margin-left: -4px !important;
        margin-right: -4px !important;
    }
}

@media (min-width: 1200px) {
    .row.g-3,
    .row.g-3.mx-0,
    .row.product-grid-uniform,
    #latestProductsContainer.row,
    #shopProductsContainer.row,
    #searchResultsContainer.row,
    #exploreInterestsContainer.row,
    #taggedSections .row {
        margin-left: -5px !important;
        margin-right: -5px !important;
    }
}

/* ========== SEARCH PAGE STYLES ========== */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .clear-search-btn {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: #e0e0e0;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 0.7rem;
    transition: all 0.2s;
    z-index: 5;
}

.search-input-wrapper .clear-search-btn:hover {
    background: #ccc;
    color: #333;
}

.search-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-section-title i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Recent search tags */
.search-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f2f5;
    border: 1px solid #e8e8e8;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #555;
    transition: all 0.2s;
    margin: 0 6px 8px 0;
    text-decoration: none;
    white-space: nowrap;
}

.search-tag:hover {
    background: #e8eaed;
    color: #333;
    border-color: #d0d0d0;
}

.search-tag .remove-tag {
    font-size: 0.65rem;
    color: #999;
    cursor: pointer;
    padding: 2px;
    transition: color 0.2s;
    margin-left: 2px;
}

.search-tag .remove-tag:hover {
    color: #e74c3c;
}

/* Trending search item */
.trending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: #333;
    margin-bottom: 2px;
}

.trending-item:hover {
    background: #f8f9fa;
}

.trending-rank {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.trending-rank.top-1 {
    background: #ff6b6b;
    color: white;
}

.trending-rank.top-2 {
    background: #ffa502;
    color: white;
}

.trending-rank.top-3 {
    background: #ffa502;
    color: white;
    opacity: 0.8;
}

.trending-rank.normal {
    background: #f0f2f5;
    color: #999;
}

.trending-term {
    font-size: 0.85rem;
    font-weight: 500;
    flex-grow: 1;
}

.trending-count {
    font-size: 0.7rem;
    color: #999;
}

/* Interest card */
.interest-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: #333;
    margin-bottom: 8px;
}

.interest-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(111,66,193,0.1);
    transform: translateY(-1px);
}

.interest-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.interest-info {
    flex-grow: 1;
}

.interest-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.interest-count {
    font-size: 0.7rem;
    color: #999;
}

/* Browsing history product card mini */
.history-product-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: white;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
    text-decoration: none;
    color: #333;
}

.history-product-mini:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.history-product-mini img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.history-product-mini .history-info {
    flex-grow: 1;
    min-width: 0;
}

.history-product-mini .history-name {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-product-mini .history-price {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Clear all button */
.clear-all-btn {
    font-size: 0.75rem;
    color: #e74c3c;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.clear-all-btn:hover {
    background: #ffeaea;
}