/* ========================================
   TELEGRAM AMAZON PRODUCTS - STYLE CSS
   Design: Bianco e Arancione
   SUPER COMPATTO per iPhone
   ======================================== */

:root {
    --tap-primary: #FF9900;
    --tap-primary-dark: #E88A00;
    --tap-primary-light: #FFB84D;
    --tap-white: #FFFFFF;
    --tap-gray-light: #F8F9FA;
    --tap-gray: #E0E0E0;
    --tap-gray-dark: #666666;
    --tap-text: #1A1A1A;
    --tap-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --tap-shadow-hover: 0 4px 16px rgba(255, 153, 0, 0.2);
    --tap-border-radius: 12px;
}

/* Reset e base */
.tap-products-grid * {
    box-sizing: border-box;
}

/* Grid Container - Mobile COMPATTO */
.tap-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--tap-white);
}

/* Product Card - PIÙ COMPATTA su mobile */
.tap-product-card {
    background: var(--tap-white);
    border-radius: var(--tap-border-radius);
    overflow: hidden;
    box-shadow: var(--tap-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.tap-product-card:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .tap-product-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--tap-shadow-hover);
        border-color: var(--tap-primary-light);
    }
}

/* Discount Badge - Ottimizzato */
.tap-discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #FF6B00 0%, #FF9900 100%);
    color: var(--tap-white);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.4);
    letter-spacing: -0.5px;
    line-height: 1;
}

/* Product Image Link - Cliccabile */
.tap-product-image-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.tap-product-image-link:hover .tap-product-image img {
    transform: scale(1.05);
}

/* Product Image - Aspect ratio ottimizzato */
.tap-product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--tap-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.tap-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .tap-product-card:hover .tap-product-image img {
        transform: scale(1.05);
    }
}

/* Product Content - COMPATTO su mobile */
.tap-product-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--tap-white);
}

/* Product Title - Leggibile ma compatto */
.tap-product-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--tap-text);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
    letter-spacing: -0.2px;
}

/* Price Section - Compatta */
.tap-product-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.tap-old-price {
    font-size: 12px;
    color: var(--tap-gray-dark);
    text-decoration: line-through;
    font-weight: 500;
    opacity: 0.7;
    line-height: 1;
}

.tap-current-price {
    font-size: 22px;
    font-weight: 900;
    color: var(--tap-primary);
    letter-spacing: -0.8px;
    line-height: 1;
}

/* Buy Button - NUOVO DESIGN PREMIUM */
.tap-buy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #FF9900 0%, #FF6B00 100%);
    color: #FFFFFF !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.4);
    letter-spacing: 0.5px;
    line-height: 1;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.tap-buy-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.tap-buy-button:hover::before {
    left: 100%;
}

.tap-buy-button:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

@media (hover: hover) {
    .tap-buy-button:hover {
        background: linear-gradient(135deg, #FF6B00 0%, #FF4500 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 107, 0, 0.5);
        color: #FFFFFF !important;
    }
}

.tap-arrow-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.tap-buy-button:hover .tap-arrow-icon {
    transform: translateX(3px);
}

/* Forza icona freccia bianca */
.tap-arrow-icon path {
    stroke: #FFFFFF !important;
}

/* No Products Message */
.tap-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--tap-gray-dark);
    font-size: 16px;
    font-weight: 500;
}

/* Pagination */
.tap-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 24px 12px;
    flex-wrap: wrap;
}

.tap-pagination a,
.tap-pagination span {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tap-white);
    border: 2px solid var(--tap-gray);
    border-radius: 8px;
    color: var(--tap-text);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.tap-pagination a:active {
    transform: scale(0.95);
}

@media (hover: hover) {
    .tap-pagination a:hover {
        background: var(--tap-primary);
        border-color: var(--tap-primary);
        color: var(--tap-white);
    }
}

.tap-pagination .current {
    background: var(--tap-primary);
    border-color: var(--tap-primary);
    color: var(--tap-white);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* iPhone SE / Piccoli (375px) - RESTA 2 COLONNE */
@media (min-width: 375px) {
    .tap-products-grid {
        gap: 14px;
        padding: 14px;
    }
    
    .tap-product-content {
        padding: 14px;
        gap: 10px;
    }
    
    .tap-product-title {
        font-size: 15px;
        min-height: 40px;
    }
    
    .tap-current-price {
        font-size: 24px;
    }
    
    .tap-buy-button {
        padding: 14px 18px;
        font-size: 15px;
    }
}

/* iPhone Standard (390px+) */
@media (min-width: 390px) {
    .tap-products-grid {
        gap: 16px;
        padding: 16px;
    }
    
    .tap-product-content {
        padding: 16px;
    }
    
    .tap-product-title {
        font-size: 15px;
    }
    
    .tap-current-price {
        font-size: 26px;
    }
    
    .tap-discount-badge {
        font-size: 15px;
        padding: 7px 13px;
    }
}

/* iPhone Plus / Pro Max (428px+) */
@media (min-width: 428px) {
    .tap-product-title {
        font-size: 16px;
        min-height: 42px;
    }
    
    .tap-current-price {
        font-size: 28px;
    }
    
    .tap-buy-button {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* Tablet Portrait (768px+) */
@media (min-width: 768px) {
    .tap-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 20px;
    }
    
    .tap-product-content {
        padding: 18px;
        gap: 12px;
    }
    
    .tap-product-title {
        font-size: 17px;
        min-height: 46px;
    }
    
    .tap-current-price {
        font-size: 30px;
    }
    
    .tap-old-price {
        font-size: 14px;
    }
    
    .tap-discount-badge {
        font-size: 16px;
        padding: 8px 14px;
        top: 12px;
        right: 12px;
    }
    
    .tap-buy-button {
        padding: 16px 22px;
        font-size: 16px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .tap-products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
        padding: 24px;
    }
    
    .tap-product-content {
        padding: 20px;
    }
    
    .tap-product-title {
        font-size: 18px;
        min-height: 48px;
    }
    
    .tap-current-price {
        font-size: 32px;
    }
    
    .tap-discount-badge {
        font-size: 18px;
        padding: 10px 16px;
    }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
    .tap-products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 28px;
    }
}

/* Ottimizzazioni Performance */
@media (prefers-reduced-motion: reduce) {
    .tap-product-card,
    .tap-product-image img,
    .tap-buy-button,
    .tap-arrow-icon,
    .tap-pagination a {
        transition: none;
    }
}

/* Safe Area per iPhone con notch */
@supports (padding: max(0px)) {
    .tap-products-grid {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
}

/* Miglioramento tap target per iOS */
@media (pointer: coarse) {
    .tap-buy-button {
        min-height: 44px;
    }
    
    .tap-pagination a,
    .tap-pagination span {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Fix per evitare sfondo scuro involontario */
body .tap-products-grid,
.tap-product-card,
.tap-product-content {
    background-color: var(--tap-white) !important;
}

/* Assicura che il testo sia sempre nero */
.tap-product-title,
.tap-old-price {
    color: var(--tap-text) !important;
}

.tap-current-price {
    color: var(--tap-primary) !important;
}

/* ========================================
   SUPER SCONTATI SLIDER
   ======================================== */

.tap-super-deals-section {
    background: linear-gradient(135deg, #FFF5E6 0%, #FFFFFF 100%);
    padding: 24px 16px;
    margin-bottom: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(255, 153, 0, 0.1);
    overflow: hidden;
}

.tap-super-deals-header {
    text-align: center;
    margin-bottom: 20px;
}

.tap-super-deals-title {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, #FF0000 0%, #FF6B00 30%, #FF9900 50%, #FFB84D 70%, #FF9900 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    animation: tap-gradient-shift 3s ease infinite, tap-title-bounce 1s ease-out;
    filter: drop-shadow(0 2px 4px rgba(255, 107, 0, 0.3));
    position: relative;
    display: inline-block;
}

@keyframes tap-gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes tap-title-bounce {
    0% {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.tap-super-deals-subtitle {
    font-size: 14px;
    color: var(--tap-gray-dark);
    margin: 0;
    font-weight: 500;
}

.tap-super-deals-wrapper {
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(
        to right,
        transparent,
        black 5%,
        black 95%,
        transparent
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent,
        black 5%,
        black 95%,
        transparent
    );
}

.tap-super-deals-slider {
    display: flex;
    gap: 16px;
    animation: tap-scroll-left 20s linear infinite;
    width: max-content;
}

@keyframes tap-scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-33.333%);
    }
}

.tap-super-deals-slider:hover {
    animation-play-state: paused;
}

.tap-super-deal-item {
    background: var(--tap-white);
    border-radius: 12px;
    padding: 12px;
    min-width: 140px;
    max-width: 140px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 2px solid transparent;
}

.tap-super-deal-item:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(255, 153, 0, 0.3);
    border-color: var(--tap-primary);
}

.tap-super-deal-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--tap-gray-light);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tap-super-deal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tap-super-deal-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, #FF0000 0%, #FF6B00 100%);
    color: var(--tap-white);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: -0.3px;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.4);
    animation: tap-pulse 2s ease-in-out infinite;
}

@keyframes tap-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.tap-super-deal-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tap-super-deal-prices {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.tap-super-deal-old-price {
    font-size: 11px;
    color: var(--tap-gray-dark);
    text-decoration: line-through;
    font-weight: 500;
}

.tap-super-deal-price {
    font-size: 18px;
    font-weight: 900;
    color: var(--tap-primary);
    letter-spacing: -0.5px;
}

/* Responsive - Mobile */
@media (max-width: 767px) {
    .tap-super-deals-section {
        padding: 20px 12px;
        margin-bottom: 20px;
        border-radius: 12px;
    }
    
    .tap-super-deals-title {
        font-size: 26px;
    }
    
    .tap-super-deals-subtitle {
        font-size: 13px;
    }
    
    .tap-super-deal-item {
        min-width: 120px;
        max-width: 120px;
        padding: 10px;
    }
    
    .tap-super-deal-price {
        font-size: 16px;
    }
}

/* Tablet */
@media (min-width: 768px) {
    .tap-super-deals-section {
        padding: 32px 24px;
    }
    
    .tap-super-deals-title {
        font-size: 36px;
    }
    
    .tap-super-deal-item {
        min-width: 160px;
        max-width: 160px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .tap-super-deals-section {
        padding: 40px 32px;
    }
    
    .tap-super-deals-title {
        font-size: 42px;
    }
    
    .tap-super-deal-item {
        min-width: 180px;
        max-width: 180px;
    }
    
    .tap-super-deal-price {
        font-size: 20px;
    }
}


