/* ==========================================================================
   1. TELEGRAM PROMO
   ========================================================================== */
.telegram-promo {
    display: block;
    background-color: rgba(0, 123, 255, 0.9);
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 83%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.telegram-promo:hover {
    background-color: rgba(0, 123, 255, 1);
    transform: translateY(-2px);
}

.telegram-promo-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    color: #fff;
    font-size: clamp(1rem, 3vw, 1.5rem);
    gap: 15px;
}

.telegram-logo {
    height: 60px;
    border-radius: 5px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.telegram-logo:hover {
    transform: scale(1.1);
}

.telegram-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: center;
    flex: 1;
}

.telegram-title {
    font-weight: bold;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.telegram-subtitle {
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.telegram-icon {
    font-size: 1rem;
    color: #fff;
    transition: transform 0.3s ease;
}

.telegram-promo:hover .telegram-icon {
    transform: scale(1.1);
}


/* ==========================================================================
   2. DATE CONTAINER & HEADER
   ========================================================================== */
.date-container {
    background-color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 83%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    z-index: 1;
}

.date-header {
    padding: 15px 20px;
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #008080;
    background-color: rgba(255, 255, 255, 0.8);
    text-align: center;
    transition: background-color 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.date-header:hover {
    background-color: rgba(233, 247, 255, 0.9);
}

.date-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.amazon-logo {
    height: 35px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.amazon-logo:hover {
    transform: scale(1.1);
}

.toggle-arrow {
    font-size: 1rem;
    color: #008080;
}

.toggle-arrow i {
    transition: transform 0.3s ease;
}

.date-container.open .toggle-arrow i {
    transform: rotate(180deg);
}

.toggle-message::after {
    content: "Click to open";
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: #666;
    display: block;
    font-weight: normal;
}

.date-container.open .toggle-message::after {
    content: "Click to close";
}


/* ==========================================================================
   3. PRODUCTS LIST (COLLAPSIBLE GRID)
   ========================================================================== */
.date-container .products-list {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(200px, 1fr));
    gap: 25px;
    align-items: stretch;
    justify-content: center;
    transition: max-height 0.5s ease-in-out, padding 0.3s ease-in-out;
}

.date-container.open .products-list {
    padding: 15px;
}

.date-container.open {
    max-width: 100%;
}


/* ==========================================================================
   4. PRODUCT CARD
   ========================================================================== */
.product {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    align-items: start;
    position: relative;
    max-width: 300px;
    min-width: 200px;
    margin: 0 auto;
    opacity: 0;
    padding-bottom: 15px;
    animation: fadeIn 0.5s ease forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product:nth-child(1) { animation-delay: 0.1s; }
.product:nth-child(2) { animation-delay: 0.2s; }
.product:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.product img {
    width: 100%;
    max-width: 150px;
    min-height: 200px;
    max-height: 200px;
    display: block;
    object-fit: contain;
    margin: 0 auto 10px auto;
    grid-row: 1;
}

.product-details {
    display: contents;
}

.product-details h3 {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: #333;
    margin-bottom: 8px;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
    grid-row: 2;
}

.product-details h3 a {
    color: inherit;
    text-decoration: none;
}

.product-details h3 a:hover {
    color: inherit;
    text-decoration: none;
}


/* ==========================================================================
   5. RATING SYSTEM
   ========================================================================== */
.rating {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.rating-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: #333;
    /*font-weight: bold;*/
}

.star-icon {
    position: relative;
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    line-height: 1;
    overflow: hidden;
    color: #A9A9A9;
}

.star-icon .star-bg,
.star-icon .star-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    line-height: 1; /* Added to ensure consistent vertical alignment */
    display: flex; /* Added to control positioning */
    align-items: center; /* Added to center star vertically */
}

.star-icon .star-bg {
    color: #FFC107;
}

.star-icon .star-fill {
    color: #FFC107;
    overflow: hidden;
    white-space: nowrap;
    clip-path: inset(0 0 0 0); /* Added for better rendering control */
}

.star-icon.filled {
    color: #FFC107;
}

.star-rating {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 1rem;
    color: #ccc; /* Empty star color */
}

.star.filled {
    color: #FFC107; /* Filled star color */
}

.star.half {
    color: #FFC107; /* Half star color */
}

.rating-number {
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    color: #333;
    font-weight: bold;
}

.star-icon {
    color: #FFC107;
    font-size: 1rem;
}

.review-count {
    font-family: 'Inter', sans-serif;
    color: #A9A9A9;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    display: block;
    align-items: center;
    gap: 4px;
}

.review-emoji {
    font-size: 1rem;
}


/* ==========================================================================
   6. PRICE & COUPON
   ========================================================================== */
.price-info {
    margin: 10px 0;
    min-height: 2em;
    text-align: center;
    display: block;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    grid-row: 4;
}

.original-price {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: #A9A9A9;
    text-decoration: line-through;
}

.new-price {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    color: #008080;
    font-weight: bold;
}

.coupon-button {
    padding: 2px 6px;
    background-color: #fff;
    color: #008080;
    border: 1px solid #008080;
    border-radius: 3px;
    font-weight: bold;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    text-align: center;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.3s ease, color 0.3s ease;
    display: flex;
    margin: 0 auto;
    margin-top: 3px;
    gap: 4px;
}

.coupon-button:active {
    transform: scale(0.95);
}

.coupon-button.copied {
    background-color: #28a745;
    color: #fff;
}

.coupon-button .copy-icon {
    font-size: 0.9rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.coupon-button:hover {
    background: #008080;
    color: #fff;
}

.coupon-button:disabled {
    background-color: #ccc;
    color: #666;
    border: 1px solid #666;
    cursor: not-allowed;
}


/* ==========================================================================
   7. VIEW LINK
   ========================================================================== */
.view-link {
    display: inline-block;
    padding: 5px 10px;
    background: #008080;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    grid-row: 5;
    align-self: end;
}

.view-link:hover {
    background: #006666;
}

.view-link .view-icon {
    margin-left: 5px;
    font-size: 0.9rem;
    vertical-align: middle;
}


/* ==========================================================================
   8. BADGES
   ========================================================================== */
.badge-container {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: row;
    gap: 5px;
    z-index: 10;
    opacity: 0.95;
}

.badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-special-deal {
    background-color: #FFC107;
    color: #333;
    animation: badgePulse 2s infinite ease-in-out;
}

.badge-limited-time {
    background-color: #FF4444;
    animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.badge-icon {
    font-size: 0.8rem;
    margin-right: 4px;
}

.product:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   9. SPECIAL FIND CONTAINER (OVERRIDES & EXTENSIONS)
   ========================================================================== */
.special-find-container .date-header[data-bg-color="1"] {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffe66d 100%);
}

.special-find-container .date-header[data-bg-color="2"] {
    background: linear-gradient(135deg, #cdffd8 0%, #94b9ff 100%);
}

.special-find-container .date-header[data-bg-color="3"] {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.special-find-container .date-header[data-bg-color="4"] {
    background: linear-gradient(135deg, #ff9f43 0%, #ee5253 100%);
}

.special-find-container .date-header[data-bg-color="5"] {
    background: linear-gradient(135deg, #ff006e 0%, #00d4ff 100%);
}

.special-find-container .date-header[data-bg-color="6"] {
    background: linear-gradient(135deg, #80d8ff 0%, #b2fefa 100%);
}

.special-find-container .date-header[data-bg-color="7"] {
    background: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
}

.special-find-container .date-header[data-bg-color="8"] {
    background: linear-gradient(135deg, #f4d03f 0%, #16a085 100%);
}

.special-find-container .date-header[data-bg-color="9"] {
    background: linear-gradient(135deg, #008080 0%, #FF7F50 100%);
}

.special-find-container .date-header[data-bg-color="1"] .date-text,
.special-find-container .date-header[data-bg-color="1"] .date-text .special-find-headline,
.special-find-container .date-header[data-bg-color="1"] .date-text .toggle-message {
    color: #2f2f2f; /* Dark gray for Excitement */
}

.special-find-container .date-header[data-bg-color="2"] .date-text,
.special-find-container .date-header[data-bg-color="2"] .date-text .special-find-headline,
.special-find-container .date-header[data-bg-color="2"] .date-text .toggle-message {
    color: #333; /* Dark gray for Chill */
}

.special-find-container .date-header[data-bg-color="3"] .date-text,
.special-find-container .date-header[data-bg-color="3"] .date-text .special-find-headline,
.special-find-container .date-header[data-bg-color="3"] .date-text .toggle-message {
    color: #333; /* Dark gray for Emotional */
}

.special-find-container .date-header[data-bg-color="4"] .date-text,
.special-find-container .date-header[data-bg-color="4"] .date-text .special-find-headline,
.special-find-container .date-header[data-bg-color="4"] .date-text .toggle-message {
    color: #fff; /* White for Fun */
}

.special-find-container .date-header[data-bg-color="5"] .date-text,
.special-find-container .date-header[data-bg-color="5"] .date-text .special-find-headline,
.special-find-container .date-header[data-bg-color="5"] .date-text .toggle-message {
    color: #fff; /* White for Vibrant */
}

.special-find-container .date-header[data-bg-color="6"] .date-text,
.special-find-container .date-header[data-bg-color="6"] .date-text .special-find-headline,
.special-find-container .date-header[data-bg-color="6"] .date-text .toggle-message {
    color: #333; /* Dark gray for Calm */
}

.special-find-container .date-header[data-bg-color="7"] .date-text,
.special-find-container .date-header[data-bg-color="7"] .date-text .special-find-headline,
.special-find-container .date-header[data-bg-color="7"] .date-text .toggle-message {
    color: #fff; /* White for Bold */
}

.special-find-container .date-header[data-bg-color="8"] .date-text,
.special-find-container .date-header[data-bg-color="8"] .date-text .special-find-headline,
.special-find-container .date-header[data-bg-color="8"] .date-text .toggle-message {
    color: #2f2f2f; /* Dark gray for Playful */
}

.special-find-container .date-header[data-bg-color="9"] .date-text,
/*.special-find-container .date-header[data-bg-color="9"] .date-text .special-find-headline,*/
.special-find-container .date-header[data-bg-color="9"] .date-text .toggle-message {
    color: #fff; /* Dark gray for Chill 2 */
}

.special-find-container .date-header[data-bg-color="1"] .toggle-arrow,
.special-find-container .date-header[data-bg-color="1"] .toggle-arrow i {
    color: #2f2f2f; /* Match date-text for Excitement */
}

.special-find-container .date-header[data-bg-color="2"] .toggle-arrow,
.special-find-container .date-header[data-bg-color="2"] .toggle-arrow i {
    color: #333; /* Match date-text for Chill */
}

.special-find-container .date-header[data-bg-color="3"] .toggle-arrow,
.special-find-container .date-header[data-bg-color="3"] .toggle-arrow i {
    color: #333; /* Match date-text for Emotional */
}

.special-find-container .date-header[data-bg-color="4"] .toggle-arrow,
.special-find-container .date-header[data-bg-color="4"] .toggle-arrow i {
    color: #fff; /* Match date-text for Fun */
}

.special-find-container .date-header[data-bg-color="5"] .toggle-arrow,
.special-find-container .date-header[data-bg-color="5"] .toggle-arrow i {
    color: #fff; /* Match date-text for Vibrant */
}

.special-find-container .date-header[data-bg-color="6"] .toggle-arrow,
.special-find-container .date-header[data-bg-color="6"] .toggle-arrow i {
    color: #333; /* Match date-text for Calm */
}

.special-find-container .date-header[data-bg-color="7"] .toggle-arrow,
.special-find-container .date-header[data-bg-color="7"] .toggle-arrow i {
    color: #fff; /* Match date-text for Bold */
}

.special-find-container .date-header[data-bg-color="8"] .toggle-arrow,
.special-find-container .date-header[data-bg-color="8"] .toggle-arrow i {
    color: #2f2f2f; /* Match date-text for Playful */
}

.special-find-container .date-header[data-bg-color="9"] .toggle-arrow,
.special-find-container .date-header[data-bg-color="9"] .toggle-arrow i {
    color: #008080; /* Match date-text for Chill 2 */
}

/* Styles for special find product layout */
.special-find-container .special-find-products {
    display: none; /* Hidden by default, toggled by JS */
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    transition: max-height 0.5s ease; /* Smooth drop-down/up transition */
    animation: fadeIn 0.5s ease-in;
}

.special-find-container.open .special-find-products {
    display: flex; /* Shown when container is open */
}

.special-find-container .special-find-headline {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: #666;
    font-weight: normal;
    margin-bottom: 3px;
}

.special-find-container .special-find-head-text{
    margin-bottom: 7px;
}

/* 2. Style special_finds_header to match Page B's banner text */
.special-find-container .date-header .date-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #fff;
    line-height: 1.2;
    text-align: center;
    margin: 0;
}

.special-find-container .special-find-item {
    width: calc(100% - 20px); /* Full width minus 10px margins */
    margin: 30px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    align-items: center;
    background: #fff; /* Match .product background */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Subtle shadow */
    border: 1px solid #ddd; /* Light border */
    border-radius: 8px; /* Rounded corners */
    padding: 15px 15px 10px 15px; /* Internal padding */
}

.special-find-container .product-content {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
}

.special-find-container .product-image {
    width: 80%;
    max-width: 370px
}

.special-find-container .product-image img {
    width: 100%;
    height: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Subtle shadow */
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.special-find-container .product-image:hover img {
    transform: scale(1.05);
}

.special-find-container .product-details {
    width: 100%;
    align-items: flex-start;
    text-align: left;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.special-find-container .product-details h3 {
    font-family: 'Roboto', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
    font-weight: 700;
    color: #222;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    line-height: 1.3;
    max-height: 3.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: left;
}

.special-find-container .product-details h3 a {
    color: inherit;
    text-decoration: none;
}

.special-find-container .rating {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.special-find-container .rating-value {
    justify-content: flex-start;
}

.special-find-container .star-rating {
    display: flex;
    gap: 4px;
}

.special-find-container .star {
    font-size: 1.2rem;
    color: #ccc;
}

.special-find-container .star.filled {
    color: #FFC107;
}

.special-find-container .star.half {
    color: #FFC107;
}

.special-find-container .price-info {
    display: flex;
    flex-direction: row; /* Changed from column to row to position the promo code button next to the prices */
    align-items: center; /* Align items vertically in the row for better fit */
    justify-content: flex-start; /* Align to the start for left-aligned text consistency */
    gap: 8px; /* Small gap between prices and button as requested */
    flex-wrap: wrap; /* Allow wrapping if needed on smaller screens, preventing overflow */
    margin: 5px 0; /* Reduced top/bottom margin to decrease the overall gap between reviews and price section */
}

.special-find-container .original-price,
.special-find-container .new-price {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.special-find-container .original-price {
    color: #A9A9A9;
    text-decoration: line-through;
}

.special-find-container .new-price {
    color: #008080;
    font-weight: bold;
    font-size: clamp(1rem, 2.2vw, 1.2rem);
}

.special-find-container .coupon-button { /* Added override to remove margins for better fit in row layout */
	margin: 0;
}

.special-find-container .rating-number {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: #333;
    font-weight: bold;
}

.special-find-container .badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.special-find-container .view-link {
    display: inline-flex;
    align-items: center;
    justify-content:left;
    gap: 8px;
    padding: 12px 24px;
    background: #008080;
    color: #FFF;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    width: 100%;
    margin: 15px auto 0;
    text-align: left;
    transition: background 0.3s ease, transform 0.3s ease;
    animation: pulse 2s infinite;
}

.special-find-container .view-link:hover {
    background: #006666;
    transform: scale(1.05);
}

.special-find-container .view-link .view-icon {
    font-size: 1.1rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Animation for fade-in effect */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   10. LAZY LOADING & SPINNER
   ========================================================================== */
#load-more {
    height: 20px;
    width: 83%;
    max-width: 1000px;
    margin: 20px auto;
}

#loading-spinner {
    display: none;
    width: 83%;
    max-width: 1000px;
    margin: 10px auto;
    text-align: center;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 123, 255, 0.2);
    border-top: 4px solid #008080;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   11. HEBREW PAGE CLASSES CHANGE
   ========================================================================== */
   
  /* Hebrew override */
.hebrew-page .toggle-message::after {
    content: "לחץ לפתיחה";
}

.hebrew-page .date-container.open .toggle-message::after {
    content: "לחץ לסגירה";
}

.hebrew-page .special-find-container .review-count{
    text-align: right;
}

.hebrew-page .special-find-container .view-link{
    justify-content: right;
    text-align: right;
}

.hebrew-page .badge-container{
    right: 10px;
}

/* ==========================================================================
   12. ACCESSIBILITY & REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .amazon-logo,
    .toggle-arrow i,
    .telegram-logo,
    .telegram-icon,
    .badge-special-deal,
    .badge-limited-time,
    .product,
    .coupon-button,
    .products-list,
    .view-link,
    .telegram-promo,
    .spinner {
        transition: none;
        animation: none;
    }
}

/* ==========================================================================
   13. BACKGROUND ANIMATION FIX - Add at the end of deals_page.css
   ========================================================================== */
.background-animation .background-tag:nth-child(1) { 
    animation-delay: 0s; 
}
.background-animation .background-tag:nth-child(2) { 
    animation-delay: 0.75s; 
}
.background-animation .background-tag:nth-child(3) { 
    animation-delay: 1.5s; 
}
.background-animation .background-tag:nth-child(4) { 
    animation-delay: 2.25s; 
}
.background-animation .background-tag:nth-child(5) { 
    animation-delay: 3s; 
}
.background-animation .background-tag:nth-child(6) { 
    animation-delay: 3.75s; 
}
.background-animation .background-tag:nth-child(7) { 
    animation-delay: 4.5s; 
}
.background-animation .background-tag:nth-child(8) { 
    animation-delay: 5.25s; 
}

@keyframes backgroundTagPulse {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    25% { opacity: 0.6; transform: scale(1.2); }
    50% { opacity: 0; transform: scale(0.8); }
}

.background-animation .background-tag {
    animation: backgroundTagPulse 6s infinite ease-in-out;
}

/* ==========================================================================
   14. MEDIA QUERIES – DESKTOP TO TABLET (≤1000px)
   ========================================================================== */
@media (max-width: 1000px) {
    .date-container .products-list {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 25px;
        justify-content: center;
    }
}


/* ==========================================================================
   15. MEDIA QUERIES – TABLET & SMALL DESKTOP (≤768px)
   ========================================================================== */
@media (max-width: 768px) {
    .telegram-promo,
    .date-container {
        width: 90%;
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .telegram-promo-content,
    .date-header {
        padding: 8px 12px;
        font-size: clamp(0.8rem, 2vw, 1rem);
        gap: 8px;
    }

    .telegram-text,
    .date-text {
        gap: 4px;
    }

    .telegram-logo,
    .amazon-logo {
        height: 30px;
    }

    .telegram-title {
        font-size: clamp(0.8rem, 2vw, 1rem);
    }

    .telegram-subtitle {
        font-size: clamp(0.7rem, 1.8vw, 0.9rem);
    }

    .telegram-icon {
        font-size: 0.8rem;
    }

    .toggle-arrow {
        font-size: 0.8rem;
    }

    .toggle-message::after {
        font-size: clamp(0.7rem, 1.8vw, 0.9rem);
    }

    .date-container .products-list {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
        gap: 5px;
        padding: 0;
        justify-content: center;
    }

    .date-container.open .products-list {
        padding: 8px;
    }

    .product {
        max-width: 315px;
        min-width: 100px;
        padding: 8px;
    }

    .product:hover {
        transform: translateY(-3px);
    }

    .product img {
        max-width: 80px;
        min-height: 160px;
        max-height: 160px;
    }

    .product-details h3 {
        font-size: clamp(0.6rem, 1.5vw, 0.8rem);
    }

    .rating {
        font-size: clamp(0.4rem, 1vw, 0.5rem);
        gap: 2px;
    }

    .rating-value {
        font-size: clamp(0.6rem, 1.6vw, 0.75rem);
        gap: 2px;
    }

    .star {
        font-size: 0.7rem;
    }

    .rating-number {
        font-size: clamp(0.6rem, 1.6vw, 0.75rem);
    }

    .star-icon {
        font-size: 0.6rem;
    }

    .review-count {
        font-size: clamp(0.5rem, 1.6vw, 0.65rem);
        gap: 2px;
    }

    .review-emoji {
        font-size: 0.6rem;
    }

    .price-info {
        margin: 0 0 3px 0;
        gap: 2px;
    }

    .original-price {
        font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    }

    .new-price {
        font-size: clamp(0.6rem, 1.5vw, 0.7rem);
        padding: 1px 3px;
    }

    .coupon-button {
        font-size: clamp(0.5rem, 1.2vw, 0.6rem);
        padding: 1px 3px;
        margin-top: 0;
        margin-bottom: 2px;
        gap: 1px;
    }

    .coupon-button .copy-icon {
        font-size: 0.5rem;
    }

    .view-link {
        padding: 5px 6px;
        font-size: 0.6rem;
        min-height: 1.8em;
        line-height: 1.3em;
        background-color: #008080;
        color: #fff;
        border: 1px solid #008080;
    }

    .view-link .view-icon {
        font-size: 0.6rem;
    }

    .badge-container {
        top: 5px;
        left: 5px;
        gap: 3px;
    }

    .badge {
        font-size: 0.5rem;
        padding: 2px 6px;
        gap: 2px;
    }

    .badge-icon {
        font-size: 0.5rem;
        margin-right: 2px;
    }
    
    .special-find-container .date-text .special-find-headline {
        font-size: clamp(0.8rem, 2vw, 1rem);
    }
    
    .special-find-container .date-header .special-find-head-text {
	font-size: clamp(0.9rem, 2.3vw, 1.1rem);
        font-weight: 600;
    }

    .special-find-container .special-find-products {
	    padding: 0;  /* Set default padding to 0 when not open, to allow transition */
	    background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        transition: 
        max-height 0.5s ease-in-out,
        padding 0.3s ease-in-out;
    }
    
    .special-find-container.open .special-find-products {
	    padding: 6px;  /* Apply padding only when open, enabling smooth transition similar to larger screens */
    }
    .special-find-container .special-find-item {
        position: relative; /* Anchor for absolute .view-link */
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin: 0;
        width: 100%;
        padding-bottom: 44px; /* Space for full-width button; adjust if button height changes */
    }

    /* 2. Horizontal row: Image + Details */
    .special-find-container .product-content {
        display: flex;
        flex-direction: row;
        gap: 15px;
        align-items: center;
        width: 100%;
    }

    /* Image: fixed width, maintain aspect */
    .special-find-container .product-image {
        flex: 0 0 120px;
        width: 150px;
        height: auto;
    }

    .special-find-container .product-image img {
        width: 100%;
        height: auto;
        max-height: 140px;
        object-fit: contain;
        border-radius: 6px;
    }

    /* Product details: take remaining space */
    .special-find-container .product-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 4px;
        min-width: 0; /* Allows text truncation */
    }

    /* Title: responsive, 2 lines max */
    .special-find-container .product-details h3 {
        font-size: clamp(0.85rem, 2.2vw, 1rem);
        line-height: 1.3;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Rating & reviews */
    .special-find-container .rating {
        gap: 3px;
        font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    }

    .special-find-container .star-rating {
        gap: 1px;
    }

/* Price info */
.special-find-container .price-info {
display: flex;
flex-direction: row; /* Changed from column to row to position the promo code button next to the prices */
align-items: center; /* Align items vertically in the row for better fit */
justify-content: flex-start; /* Align to the start for left-aligned text consistency */
gap: 5px; /* Small gap between prices and button as requested */
flex-wrap: wrap; /* Allow wrapping if needed on smaller screens, preventing overflow */
margin: 2px 0; /* Reduced top/bottom margin to decrease the overall gap between reviews and price section */
}

    .special-find-container .original-price {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    }

    .special-find-container .new-price {
        font-size: clamp(0.9rem, 2.2vw, 1.05rem);
        font-weight: bold;
    }

    .special-find-container .coupon-button {
        align-self: center; /* Changed to center for vertical alignment in row layout */
        font-size: clamp(0.7rem, 1.6vw, 0.8rem);
        padding: 3px 8px;
        margin: 0; /* Added to remove any margins for better fit in row */
    }

    /* 3. FULL-WIDTH VIEW LINK BELOW BOTH – use absolute to span full item width */
    .special-find-container .view-link {
        position: absolute;
        bottom: 10px;
        left: 20px;
        right: 20px;
        width: auto; /* Auto to fit content, but spans via left/right */
        margin-top: 0;
        padding: 10px;
        font-size: clamp(0.85rem, 2vw, 1rem);
        text-align: center;
        background-color: #008080;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .special-find-container .view-link:hover {
        background-color: #006666;
    }

    .special-find-container .view-link .view-icon {
        font-size: 1rem;
    }

    /* Badge container: reposition slightly */
    .special-find-container .badge-container {
        top: 8px;
        left: 8px;
        gap: 4px;
    }

    .special-find-container .badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    /*.special-find-container .star {*/
    /*    font-size: 0.9rem;*/
    /*}*/

    /*.special-find-container .rating-number {*/
    /*    font-size: clamp(0.7rem, 1.8vw, 0.9rem);*/
    /*}*/

    #load-more {
        height: 20px;
        width: 90%;
        max-width: 1000px;
        margin: 15px auto;
    }

    #loading-spinner {
        width: 90%;
        max-width: 1000px;
        margin: 8px auto;
    }

    .spinner {
        width: 32px;
        height: 32px;
        border: 3px solid rgba(0, 123, 255, 0.2);
        border-top: 3px solid #008080;
    }
}


/* ==========================================================================
   16. MEDIA QUERIES – MOBILE (≤480px)
   ========================================================================== */
@media (max-width: 480px) {
    .telegram-promo,
    .date-container {
        width: 97%;
        max-width: 97%;
        margin: 0 auto;
        margin-bottom: 15px;
    }

    .telegram-promo-content,
    .date-header {
        padding: 8px 10px;
        font-size: clamp(0.8rem, 2vw, 1rem);
        gap: 6px;
    }

    .telegram-text,
    .date-text {
        gap: 3px;
    }

    .telegram-logo {
        height: 28px;
    }

    .amazon-logo {
        height: 20px;
    }

    .telegram-title {
        font-size: clamp(0.7rem, 1.8vw, 0.9rem);
    }

    .telegram-subtitle {
        font-size: clamp(0.55rem, 1.3vw, 0.75rem);
    }

    .telegram-icon {
        font-size: 0.7rem;
    }

    .toggle-arrow {
        font-size: 0.7rem;
    }

    .toggle-message::after {
        font-size: clamp(0.6rem, 1.5vw, 0.8rem);
    }

    .date-container .products-list {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 5px;
        padding: 0;
        justify-content: center;
    }

    .date-container.open .products-list {
        padding: 8px;
    }

    .product {
        padding: 8px;
        max-width: 200px;
        min-width: 150px;
    }

    .product-details h3 {
        font-size: clamp(0.6rem, 1.5vw, 0.8rem);
    }

    .rating {
        font-size: clamp(0.5rem, 1.2vw, 0.6rem);
        gap: 2px;
    }

    .star {
        font-size: 0.7rem;
    }

    .rating-number {
        font-size: clamp(0.55rem, 0.9vw, 0.70rem);
    }

    .star-icon {
        font-size: 0.7rem;
        width: 1.1em;
        height: 1em;
    }

    .review-count {
        font-size: clamp(0.55rem, 0.9vw, 0.70rem);
        gap: 2px;
    }

    .review-emoji {
        font-size: 0.7rem;
    }

    .price-info {
        margin: 0 0 4px 0;
        gap: 2px;
    }

    .original-price {
        font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    }

    .new-price {
        font-size: clamp(0.6rem, 1.5vw, 0.7rem);
        padding: 1px 3px;
    }

    .coupon-button {
        font-size: clamp(0.5rem, 1.2vw, 0.6rem);
        padding: 1px 3px;
        gap: 1px;
    }

    .view-link {
        font-size: 0.7rem;
        padding: 2px 6px;
        min-height: 1.8em;
        line-height: 1.3em;
    }

    .view-link .view-icon {
        font-size: 0.5rem;
    }

    .badge {
        font-size: 0.5rem;
        padding: 2px 6px;
        gap: 2px;
    }

    .badge-icon {
        font-size: 0.5rem;
        margin-right: 2px;
    }

    .special-find-container .date-text .special-find-headline {
        font-size: clamp(0.7rem, 1.8vw, 0.9rem);
    }
    
    .special-find-container .date-header .special-find-head-text {
        /* Base: 0.8rem → we go to 0.9rem min */
        /* Max: 1rem → allow up to 1.05rem */
        font-size: clamp(0.9rem, 2.8vw, 1.05rem);
    }
    
    .special-find-container.open .special-find-products {
	    padding: 4px 1px;  /* Apply padding only when open, enabling smooth transition similar to larger screens */
    }

    .special-find-container .special-find-item {
        margin: 0 5px;
        padding-bottom: 44px; /* Slightly less padding for smaller screens */
    }

.special-find-container .product-content {
        gap: 10px;
    }

    .special-find-container .product-image {
        flex: 0 0 120px;
        width: 120px;
    }

    .special-find-container .product-image img {
        max-height: 120px;
    }

    .special-find-container .product-details h3 {
        font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    }

    .special-find-container .product-details {
        /* Added to reduce gap between elements in product-details for consistency with base modifications */
	gap: 2px; /* Reduced gap to make overall spacing tighter, specifically reducing the visual gap between reviews and price */
    }

    .special-find-container .price-info {
        display: flex;
        /* Added to ensure flex display is set (inherits but explicit for safety) */
    	flex-direction: row; /* Changed from inherited column to row to position the promo code button next to the prices */
    	align-items: center; /* Align items vertically in the row for better fit */
    	justify-content: flex-start; /* Align to the start for left-aligned text consistency */
    	gap: 4px; /* Small gap between prices and button as requested (slightly smaller for mobile) */
    	flex-wrap: wrap; /* Allow wrapping if needed on smaller screens, preventing overflow */
    	margin: 1px 0; /* Reduced top/bottom margin to decrease the overall gap between reviews and price section */
    }

    .special-find-container .view-link {
        padding: 8px;
        left: 15;
        right: 15;
        font-size: clamp(0.8rem, 2.3vw, 0.95rem);
        margin-top: 8px;
    }

    .special-find-container .coupon-button {
        font-size: clamp(0.65rem, 1.5vw, 0.75rem);
        padding: 2px 6px;
        margin: 0; /* Added to remove any margins for better fit in row */
	align-self: center; /* Added for vertical alignment in row layout */
    }

    .special-find-container .badge {
        font-size: 0.6rem;
        padding: 2px 5px;
    }

    .special-find-container .rating {
        margin-top: 5px;
    }

    #load-more {
        height: 20px;
        width: 97%;
        max-width: 97%;
        margin: 10px auto;
    }

    #loading-spinner {
        width: 97%;
        max-width: 97%;
        margin: 5px auto;
    }

    .spinner {
        width: 24px;
        height: 24px;
        border: 2px solid rgba(0, 123, 255, 0.2);
        border-top: 2px solid #008080;
    }
}
