/* =============================================
   EMOJI NORMALIZATION — Fix oversized emojis
   ============================================= */
.nm-store-card img.emoji,
.nm-product-card img.emoji,
.nm-product-card-title img.emoji,
.nm-store-card-title img.emoji,
.nm-product-card-price img.emoji,
.emoji {
    max-width: 1em !important;
    max-height: 1em !important;
    height: auto !important;
    width: auto !important;
    display: inline-block !important;
    vertical-align: middle;
    margin: 0 2px;
}

/* Force emoji to normal size in text elements */
.nm-product-card-title,
.nm-store-card-title,
.nm-product-card-price {
    line-height: 1.3;
}

/* Prevent emoji from breaking layout */
.nm-product-card-title img.emoji,
.nm-store-card-title img.emoji {
    vertical-align: text-bottom;
}

/* =============================================
   NOSOTRAS MARKET — Premium Marketplace Styles
   ============================================= */

/* ── Shared Card Base ── */
.metallic-card {
    background: rgba(15, 23, 42, 0.4) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 2rem;
}

/* ── Seller Tabs ── */
.seller-tab-btn.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.seller-tab-content {
    animation: nmFadeIn 0.3s ease-out forwards;
}

/* =============================================
   STORE CARD (Listing Grid)
   ============================================= */
.nm-store-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.nm-store-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(236, 72, 153, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 30px rgba(236, 72, 153, 0.08);
}

/* Mini Banner */
.nm-store-card-banner {
    height: 100px;
    background: url('../../../assets/img/fondo-tienda.jfif');
    background-size: 200px;
    background-repeat: repeat;
    position: relative;
    overflow: hidden;
}
.nm-store-card-banner::after {
    display: none;
}
.nm-store-card-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(15, 23, 42, 0.8) 100%);
}
.nm-store-card-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: white;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
}

/* Floating Avatar */
.nm-store-card-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-top: -35px;
    position: relative;
    z-index: 3;
}
.nm-store-card-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid rgba(15, 23, 42, 0.9);
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    background: #1e293b;
}

/* Card Body */
.nm-store-card-body {
    padding: 12px 20px 20px;
    text-align: center;
}
.nm-store-card-title {
    font-size: 1rem;
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}
.nm-store-card-owner {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}
.nm-store-card-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    margin-top: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nm-store-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.nm-store-card-count {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(236, 72, 153, 0.8);
}
.nm-store-card-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

/* =============================================
   STORE INTERIOR — Banner + Owner + Products
   ============================================= */

/* Banner */
.nm-store-banner {
    height: 160px;
    background: url('../../../assets/img/fondo-tienda.jfif');
    background-size: 250px;
    background-repeat: repeat;
    border-radius: 1.5rem 1.5rem 0 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.nm-store-banner::before {
    display: none;
}
.nm-store-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(0,0,0,0.5) 100%);
}
.nm-store-banner-content {
    position: relative;
    z-index: 2;
    padding: 24px;
    width: 100%;
}
.nm-store-banner-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.nm-store-banner-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 15px rgba(0,0,0,0.3);
}

/* Owner Card */
.nm-store-owner-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-top: none;
    border-radius: 0 0 1.5rem 1.5rem;
    padding: 16px 24px;
}
.nm-store-owner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.nm-store-owner-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(236, 72, 153, 0.3);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.15);
    flex-shrink: 0;
}
.nm-store-owner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nm-store-owner-name {
    font-size: 1rem;
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.nm-store-owner-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}
.nm-store-owner-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* WhatsApp Button */
.nm-btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white !important;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 14px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
}
.nm-btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    color: white !important;
}
.nm-btn-whatsapp i {
    font-size: 16px;
}

/* =============================================
   PRODUCT CARD (Inside Store)
   ============================================= */
.nm-product-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.2rem;
    overflow: hidden;
    transition: all 0.3s ease;
}
.nm-product-card:hover {
    border-color: rgba(236, 72, 153, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}
.nm-product-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #1e293b;
    display: block;
}

/* Download Image Button (Marketing) — Always visible for mobile/desktop */
.nm-download-img-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(210, 78, 142, 0.85), rgba(126, 63, 163, 0.85));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(210, 78, 142, 0.4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(210, 78, 142, 0.3);
    z-index: 5;
}

.nm-download-img-btn:hover {
    background: linear-gradient(135deg, rgba(210, 78, 142, 1), rgba(126, 63, 163, 1));
    border-color: rgba(210, 78, 142, 0.6);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(210, 78, 142, 0.5);
}

.nm-download-img-btn:active {
    transform: scale(0.95);
}

/* Mobile: slightly larger touch target */
@media (max-width: 640px) {
    .nm-download-img-btn {
        width: 40px;
        height: 40px;
        bottom: 10px;
        right: 10px;
    }
}
.nm-product-card-body {
    padding: 12px 14px 16px;
}
.nm-product-card-title {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
.nm-product-card-price {
    font-size: 1.1rem;
    font-weight: 900;
    color: #ec4899;
    margin-bottom: 10px;
}
.nm-btn-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 0;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.2);
}
.nm-btn-buy:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 25px rgba(236, 72, 153, 0.35);
}
.nm-btn-buy:active {
    transform: scale(0.97);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes nmFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes nmFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nm-product-card {
    animation: nmFadeInUp 0.4s ease-out forwards;
}
.nm-product-card:nth-child(1) { animation-delay: 0.0s; }
.nm-product-card:nth-child(2) { animation-delay: 0.05s; }
.nm-product-card:nth-child(3) { animation-delay: 0.1s; }
.nm-product-card:nth-child(4) { animation-delay: 0.15s; }
.nm-product-card:nth-child(5) { animation-delay: 0.2s; }
.nm-product-card:nth-child(6) { animation-delay: 0.25s; }
.nm-product-card:nth-child(7) { animation-delay: 0.3s; }
.nm-product-card:nth-child(8) { animation-delay: 0.35s; }

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
    .nm-store-banner {
        height: 120px;
        border-radius: 1rem 1rem 0 0;
    }
    .nm-store-banner-title {
        font-size: 1.25rem;
    }
    .nm-store-owner-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        border-radius: 0 0 1rem 1rem;
    }
    .nm-store-owner-actions {
        width: 100%;
    }
    .nm-btn-whatsapp {
        width: 100%;
        justify-content: center;
    }
    .nm-store-card-banner {
        height: 80px;
    }
    .nm-store-card-avatar {
        width: 56px;
        height: 56px;
    }
    .nm-store-card-avatar-wrap {
        margin-top: -28px;
    }
    .nm-product-card-body {
        padding: 10px 12px 14px;
    }
}

/* =============================================
   BACK BUTTON — Universal
   ============================================= */
.nm-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.4);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    transition: all 0.3s ease;
}
.nm-back-btn:hover {
    color: white;
}
.nm-back-btn i {
    transition: transform 0.3s ease;
}
.nm-back-btn:hover i {
    transform: translateX(-4px);
}

/* =============================================
   BUY PRODUCT MODAL — Premium Redesign
   ============================================= */
#buyProductModal .custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
#buyProductModal .custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
    border-radius: 3px;
}
#buyProductModal .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(236, 72, 153, 0.3);
    border-radius: 3px;
}
#buyProductModal .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(236, 72, 153, 0.5);
}

/* Mobile Optimizations for Purchase Form */
@media (max-width: 480px) {
    #buyProductModal .grid-cols-1.sm\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    #buyProductModal input[type="text"],
    #buyProductModal input[type="tel"],
    #buyProductModal input[type="number"],
    #buyProductModal textarea {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        padding-left: 2.75rem;
    }

    #buyProductModal button[type="submit"] {
        padding-top: 1rem;
        padding-bottom: 1rem;
        font-size: 0.75rem;
    }
}

/* Touch-friendly quantity buttons */
#buyProductModal button[onclick^="updateQty"] {
    min-width: 36px;
    min-height: 36px;
    -webkit-tap-highlight-color: transparent;
}

/* Focus states for accessibility */
#buyProductModal input:focus,
#buyProductModal textarea:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}

/* Animation for modal open */
@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#buyProductModal > div:last-child {
    animation: modalSlideUp 0.3s ease-out forwards;
}
