/* ========================================
   PRODUCTS CSS - PLP Styles
   ======================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--color-gray-6);
    background-color: #ffffff;
    line-height: 1.6;
}

/* Header Styles */
.header-esim {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-esim header {
    padding: 1rem 1.5rem !important;
}

.header-esim header a {
    display: flex;
    align-items: center;
}

.header-esim header img {
    height: 28px;
}

/* Hero Section */
.hero-plp {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-dark-blue) 100%);
    padding: 80px 0 60px;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-plp::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    z-index: 0;
}

.hero-plp .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.stat-item i {
    font-size: 1.5rem;
}

/* Marquee animation for mobile */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.hero-stats-wrapper {
    width: 100%;
    overflow: hidden;
}

.hero-stats.marquee-mode {
    display: flex;
    width: max-content;
    animation: marquee 20s linear infinite;
    will-change: transform;
}

.hero-stats.marquee-mode .stat-item {
    flex: 0 0 auto;
    padding: 0 2rem;
    white-space: nowrap;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.filters-toggle {
    display: none;
}

.filters-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filters-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 600;
    color: var(--color-gray-5);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.filter-select {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--color-gray-2);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    background: white;
    color: var(--color-gray-6);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.filter-select:hover {
    border-color: var(--color-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(1, 157, 244, 0.1);
}

.btn-clear-filters {
    padding: 0.6rem 1.2rem;
    border: none;
    background: var(--color-gray-1);
    color: var(--color-gray-5);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-clear-filters:hover {
    background: var(--color-gray-2);
    color: var(--color-gray-6);
}

/* Products Section */
.products-section {
    padding: 3rem 0 5rem;
    background: var(--color-gray-1);
}

.products-count {
    margin-bottom: 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-5);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--color-accent-purple);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-badge.badge-discount {
    background: var(--color-accent-orange);
}

.product-image-wrapper {
    position: relative;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
}

.product-image-cel {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image-cel {
    transform: scale(1.05);
}

.product-info {
    padding: 1rem 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 0.85rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
}

.product-model {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-6);
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.product-storage {
    font-size: 0.9rem;
    color: var(--color-gray-4);
    margin-bottom: 0.75rem;
}

.product-pricing {
    margin-bottom: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-gray-2);
}

.price-before {
    display: block;
    font-size: 0.9rem;
    color: var(--color-gray-4);
    text-decoration: line-through;
    margin-bottom: 0.25rem;
}

.price-current {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.price-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-gray-6);
}

.price-installments {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-gray-5);
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    margin-top: 0.4rem;
}

.price-installments i {
    color: var(--color-primary);
}

/* Mostrar/ocultar versiones de cuotas según pantalla */
.installments-mobile {
    display: none;
}

.installments-desktop {
    display: inline;
}

@media (max-width: 576px) {
    .installments-mobile {
        display: inline;
    }
    
    .installments-desktop {
        display: none;
    }
}

/* Banner de descuento con plan */
.plan-discount-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    line-height: 1.3;
    border-left: 3px solid #4caf50;
}

button.plan-discount-banner:focus{
  outline: none;
  background-color: 0 0 0 3px rgba(8, 36, 9, 0.25);
}

button.plan-discount-banner {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  position: relative;
  border-left: 3px solid #4caf50;
  width: 100%;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.3s ease;
}

.plan-discount-banner i {
    font-size: 1rem;
    flex-shrink: 0;
}

.plan-discount-banner strong {
    color: #1b5e20;
    font-weight: 700;
}

button.plan-discount-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #c2e0c3 0%, #a7d4a9 100%); 
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}
button.plan-discount-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, .3);
}

button.plan-discount-banner:hover::after {
  opacity: 1;
}

button.plan-discount-banner > * {
  position: relative;
  z-index: 1;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: #0188d1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 157, 244, 0.3);
}

.btn-link {
    background: transparent;
    color: var(--color-primary);
    border: none;
    padding: 0.5rem;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
}

.btn-link:hover {
    color: var(--color-dark-blue);
    text-decoration: underline;
    transform: none;
    box-shadow: none;
}

.btn-details {
    text-decoration: none;
}

.btn-buy i {
    font-size: 1.1rem;
}

/* Features Section */
.features-section {
    padding: 4rem 0;
    background: white;
}

.feature-card {
    text-align: center;
    padding: 2rem 1rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.feature-card h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-gray-6);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--color-gray-4);
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
}

.empty-state i {
    font-size: 5rem;
    color: var(--color-gray-3);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-5);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--color-gray-4);
}

/* Responsive */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-plp {
        padding: 40px 0 30px;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-stats-wrapper {
        overflow: hidden;
        width: 100%;
        mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    }
    
    .hero-stats {
        display: flex;
        justify-content: center;
    }
    
    .hero-stats.marquee-mode {
        justify-content: flex-start;
        width: max-content;
        animation: marquee 20s linear infinite;
    }
    
    .hero-stats.marquee-mode .stat-item {
        flex: 0 0 auto;
        padding: 0 2.5rem;
    }
    
    .stat-item {
        font-size: 0.95rem;
    }
    
    /* Header sticky */
    .header-esim {
        position: sticky;
        top: 0;
        z-index: 999;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .header-esim header {
        justify-content: center !important;
    }
    
    /* Filters collapsible */
    .filters-section {
        position: static;
        padding: 1rem 0;
    }
    
    .filters-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 1rem 1.5rem;
        background: var(--color-primary);
        color: white;
        border: none;
        border-radius: 10px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(1, 157, 244, 0.3);
    }
    
    .filters-toggle:hover {
        background: var(--color-dark-blue);
    }
    
    .filters-toggle i {
        font-size: 1.2rem;
        transition: transform 0.3s ease;
    }
    
    .filters-toggle.active i {
        transform: rotate(180deg);
    }
    
    .filters-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.4s ease;
        opacity: 0;
        flex-direction: column;
        gap: 1rem;
        margin-top: 0;
    }
    
    .filters-content.active {
        max-height: 500px;
        opacity: 1;
        margin-top: 1rem;
    }
    
    .filters-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-label {
        display: none;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .products-section {
        padding: 2rem 0 4rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .product-card {
        border-radius: 12px;
    }
    
    .product-image-wrapper {
        min-height: 200px;
        padding: 1.5rem 1rem;
    }
    
    .product-image-cel {
        max-height: 180px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-brand {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }
    
    .product-model {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }
    
    .product-storage {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
    }
    
    .product-pricing {
        padding-top: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .price-amount {
        font-size: 1.5rem;
    }
    
    .price-installments {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn i {
        font-size: 1rem;
    }
    
    .feature-card {
        padding: 1.5rem 0.8rem;
    }
    
    .feature-card i {
        font-size: 2.5rem;
    }
    
    .feature-card h5 {
        font-size: 1rem;
    }
    
    .feature-card p {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .hero-plp {
        padding: 30px 0 25px;
    }
    
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 0.6rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }
    
    .hero-stats.marquee-mode .stat-item {
        padding: 0 2rem;
        font-size: 0.9rem;
    }
    
    .products-section {
        padding: 1.5rem 0 3rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .product-card {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .product-image-wrapper {
        min-height: 200px;
        padding: 1.5rem 1rem;
    }
    
    .product-image-cel {
        max-height: 180px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-brand {
        font-size: 0.75rem;
    }
    
    .product-model {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    .product-storage {
        font-size: 0.8rem;
    }
    
    .price-amount {
        font-size: 1.5rem;
    }
    
    .price-installments {
        font-size: 0.75rem;
    }
    
    .plan-discount-banner {
        font-size: 0.75rem;
        padding: 0.5rem 0.6rem;
        gap: 0.4rem;
    }
    
    .plan-discount-banner i {
        font-size: 0.9rem;
    }
    
    .product-actions {
        gap: 0.6rem;
        flex-direction: column;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        width: 100%;
    }
    
    .btn-link {
        font-size: 0.8rem;
    }
    
    .features-section {
        padding: 3rem 0;
    }
}
