/* Amflip Deals Helper Custom Styles */

/* 1. Category Cards Grid (Amazon homepage style) */
.amflip-amazon-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
    width: 100%;
}

.amflip-amazon-card {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 420px;
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}

.amflip-amazon-card:hover {
    box-shadow: 0 14px 28px rgba(0,0,0,0.15), 0 10px 10px rgba(0,0,0,0.12);
}

.amflip-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 19px !important;
    font-weight: 700 !important;
    margin: 0 0 15px 0 !important;
    color: #0f1111 !important;
    line-height: 1.3 !important;
}

/* 2x2 Grid Layout */
.amflip-card-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
    flex-grow: 1;
}

.amflip-grid-item {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: #0f1111;
}

.amflip-grid-img-wrapper {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f7f7f7;
    border-radius: 4px;
    margin-bottom: 6px;
    overflow: hidden;
}

.amflip-grid-img-wrapper img {
    max-height: 90%;
    max-width: 90%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.amflip-grid-item:hover img {
    transform: scale(1.05);
}

.amflip-grid-item-title {
    font-size: 12px;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    color: #565959;
    font-weight: 400;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Single Featured Product Layout */
.amflip-card-single {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-bottom: 15px;
}

.amflip-single-link {
    text-decoration: none !important;
    color: #0f1111;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.amflip-single-img {
    max-height: 220px;
    width: 100%;
    object-fit: contain;
    background: #f7f7f7;
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 10px;
}

.amflip-single-title {
    font-size: 13.5px;
    line-height: 1.4;
    color: #565959;
    text-align: center;
}

.amflip-card-link {
    font-size: 13px;
    color: #007185 !important;
    text-decoration: none !important;
    font-weight: 500;
    display: inline-block;
    align-self: flex-start;
}

.amflip-card-link:hover {
    color: #c7511f !important;
    text-decoration: underline !important;
}

/* 2. Deals Carousel */
.amflip-carousel-container {
    position: relative;
    width: 100%;
    margin: 20px 0 40px 0;
    background: #ffffff;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.amflip-carousel-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 5px;
    scrollbar-width: none; /* Firefox */
}

.amflip-carousel-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.amflip-carousel-item {
    width: 200px;
    flex-shrink: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease;
}

.amflip-carousel-item-link {
    text-decoration: none !important;
    color: #0f1111;
    display: flex;
    flex-direction: column;
}

.amflip-item-img-wrapper {
    height: 160px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f7f7f7;
    border-radius: 4px;
    margin-bottom: 12px;
    padding: 10px;
    overflow: hidden;
}

.amflip-item-img-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Badges styling */
.amflip-item-deal-badge-row, .amflip-grid-card-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.amflip-badge-discount, .amflip-grid-badge-discount {
    background-color: #cc0c39;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 2px;
    text-transform: uppercase;
}

.amflip-badge-discount.blue {
    background-color: #007185;
}

.amflip-badge-type, .amflip-grid-badge-text {
    color: #cc0c39;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Price row styling */
.amflip-item-price-row, .amflip-grid-card-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.amflip-price-symbol, .price-sale {
    font-size: 18px;
    font-weight: 700;
    color: #0f1111;
}

.amflip-price-amount {
    font-size: 21px;
    font-weight: 700;
    color: #0f1111;
    line-height: 1;
}

.amflip-price-regular, .price-regular {
    font-size: 12px;
    color: #565959;
    margin-left: 2px;
}

.amflip-item-title, .amflip-grid-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px !important;
    line-height: 1.4 !important;
    height: 2.8em !important;
    overflow: hidden !important;
    color: #0f1111 !important;
    font-weight: 500 !important;
    margin: 5px 0 10px 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

/* Buttons styling */
.amflip-buy-btn, .amflip-grid-buy-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    margin-top: 10px;
    cursor: pointer;
    border: 1px solid;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.amazon-btn {
    background: #ffd814;
    border-color: #fcd200;
    color: #0f1111 !important;
}

.amazon-btn:hover {
    background: #f7ca00;
    border-color: #f2c200;
}

.add-to-cart-btn {
    background: #ffa41c;
    border-color: #ff9900;
    color: #ffffff !important;
}

.add-to-cart-btn:hover {
    background: #e47911;
    border-color: #d76e0a;
}

/* Carousel Control Buttons */
.amflip-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: 1px solid #d5d9d9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.amflip-carousel-btn:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.amflip-carousel-btn.prev {
    left: 10px;
}

.amflip-carousel-btn.next {
    right: 10px;
}

/* 3. Product Grid */
.amflip-amazon-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 20px 0 40px 0;
    width: 100%;
}

.amflip-grid-product-card {
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #e7e7e7;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.2s ease;
}

.amflip-grid-product-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.amflip-grid-card-link {
    text-decoration: none !important;
    color: #0f1111;
    display: flex;
    flex-direction: column;
}

.amflip-grid-card-img-wrapper {
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f7f7f7;
    border-radius: 4px;
    margin-bottom: 12px;
    padding: 10px;
    overflow: hidden;
}

.amflip-grid-card-img-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.amflip-grid-card-rating {
    color: #ffa41c;
    font-size: 13px;
    margin-bottom: 6px;
}

.rating-count {
    color: #007185;
    margin-left: 4px;
}

.amflip-grid-card-price .price-sale {
    font-size: 20px;
    font-weight: 700;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .amflip-amazon-cards-grid, .amflip-amazon-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .amflip-amazon-cards-grid, .amflip-amazon-product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .amflip-amazon-card {
        min-height: auto;
    }
    .amflip-grid-img-wrapper {
        height: 120px;
    }
    .amflip-carousel-container {
        padding: 10px;
    }
    .amflip-carousel-btn {
        display: none; /* Hide arrows on touch screens */
    }
}
