/* frontend-styles.css - WooCommerce Free Delivery on Bank Transfer */
:root {
    --primary-color: #0F90B2;
    --primary-dark: #0a708a;
    --primary-light: #3faac9;
    --primary-lighter: #d1ecf1;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --text-color: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --light-bg: #f8f9fa;
    --light-border: #e9ecef;
    --white: #ffffff;
    --black: #000000;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.3s ease;
}

/* ============================================
   POPUP NOTIFICATION STYLES
   ============================================ */
.free-delivery-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border-left: 6px solid var(--primary-color);
    max-width: 450px;
    width: 90%;
    animation: slideInRight 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    border: 1px solid var(--light-border);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.popup-content {
    padding: 25px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, var(--white) 0%, #f8fdff 100%);
}

.popup-icon {
    font-size: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(15, 144, 178, 0.3);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.popup-message {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.5;
    text-align: left;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--light-bg);
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-lighter);
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.popup-close:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: rotate(90deg);
}

/* ============================================
   CHECKOUT PAGE MESSAGE - WHITE COLOR
   ============================================ */
.free-delivery-checkout-message {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white) !important;
    padding: 25px 30px;
    border-radius: var(--radius-xl);
    border: none;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    margin: 0 0 40px 0 !important;
    width: 100%;
    display: block;
    animation: fadeInUp 0.8s ease;
}

.free-delivery-checkout-message * {
    color: var(--white) !important;
}

.free-delivery-checkout-message:before {
    content: "🎉 ";
    margin-right: 10px;
    font-size: 24px;
    vertical-align: middle;
    color: var(--white) !important;
}

.free-delivery-checkout-message:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        #FFD700 0%, 
        #FFA500 25%, 
        #FF8C00 50%, 
        #FFA500 75%, 
        #FFD700 100%);
    animation: shimmer 3s infinite linear;
    background-size: 200% 100%;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% center;
    }
    100% {
        background-position: -200% center;
    }
}

/* ============================================
   CART PAGE MESSAGE - WHITE COLOR
   ============================================ */
.free-delivery-message {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white) !important;
    padding: 25px 30px;
    border-radius: var(--radius-xl);
    border: none;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    margin: 0 0 30px 0;
    animation: fadeInUp 0.8s ease;
}

.free-delivery-message * {
    color: var(--white) !important;
}

.free-delivery-message:before {
    content: "🎉 ";
    margin-right: 10px;
    font-size: 24px;
    vertical-align: middle;
    color: var(--white) !important;
}

.free-delivery-message:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        #FFD700 0%, 
        #FFA500 25%, 
        #FF8C00 50%, 
        #FFA500 75%, 
        #FFD700 100%);
    animation: shimmer 3s infinite linear;
    background-size: 200% 100%;
}

/* ============================================
   PROMOTION PAGE STYLES
   ============================================ */
.free-delivery-promotions-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.promotions-title {
    text-align: center;
    font-size: 42px;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 20px;
}

.promotions-title:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
}

.promotions-description {
    text-align: center;
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    padding: 0 20px;
}

/* ============================================
   PRODUCTS GRID LAYOUT - RESPONSIVE FIXED
   ============================================ */
.products-grid {
    display: grid;
    gap: 30px;
    position: relative;
    width: 100%;
}

/* DESKTOP: 4 columns per row */
.products-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* DESKTOP: 3 columns per row */
.products-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* DESKTOP: 2 columns per row */
.products-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* ============================================
   PROMOTION CARD STYLES
   ============================================ */
.promotion-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
    height: 100%;
    position: relative;
    animation: cardAppear 0.6s ease;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.promotion-card:hover {
    transform: translateY(-15px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* CARD IMAGE - RESPONSIVE FIXED */
.card-image {
    position: relative;
    overflow: hidden;
    background: var(--light-bg);
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* 4:3 Aspect Ratio */
}

.card-image a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    display: block;
}

.promotion-card:hover .card-image img {
    transform: scale(1.1);
}

.offer-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 15px rgba(15, 144, 178, 0.4);
    z-index: 3;
}

.card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.product-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    min-height: 56px;
}

.product-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.eligibility-info {
    background: var(--light-bg);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    border: 1px solid var(--light-border);
}

.min-quantity, .payment-method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px dashed var(--light-border);
}

.min-quantity:last-child, .payment-method:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 14px;
}

.value {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 20px;
    background: var(--white);
    padding: 8px 20px;
    border-radius: 30px;
    border: 2px solid var(--primary-light);
    min-width: 60px;
    text-align: center;
}

/* ADD TO CART BUTTON FIXED */
.card-actions {
    margin-top: auto;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.view-product-btn, .add-to-cart-btn {
    flex: 1;
    text-align: center;
    padding: 16px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    min-width: 140px;
    display: inline-block;
}

/* FIX: Remove default link styles for buttons */
.view-product-btn, 
.add-to-cart-btn,
.view-product-btn:hover, 
.add-to-cart-btn:hover,
.view-product-btn:focus, 
.add-to-cart-btn:focus,
.view-product-btn:active, 
.add-to-cart-btn:active {
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.view-product-btn {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.view-product-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

.add-to-cart-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: 2px solid transparent;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-3px);
}

/* ADD TO CART BUTTON CLICK FIX */
.add-to-cart-btn[href*="add-to-cart"] {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Force display as block for proper spacing */
.add-to-cart-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.no-products {
    text-align: center;
    font-size: 20px;
    color: var(--text-light);
    padding: 60px 40px;
    background: var(--light-bg);
    border-radius: var(--radius-xl);
    max-width: 600px;
    margin: 0 auto;
    border: 2px dashed var(--light-border);
}

/* ============================================
   RESPONSIVE DESIGN - FIXED FOR MOBILE
   ============================================ */

/* LARGE DESKTOP: 4 columns (1400px and above) */
@media (min-width: 1400px) {
    .products-grid.columns-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* MEDIUM DESKTOP: 4 columns (1200px to 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .products-grid.columns-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .promotions-title {
        font-size: 38px;
    }
    
    .card-image {
        padding-bottom: 70%; /* Slightly taller on medium screens */
    }
}

/* SMALL DESKTOP/TABLET LANDSCAPE: 3 columns (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .products-grid.columns-4,
    .products-grid.columns-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .promotions-title {
        font-size: 34px;
    }
    
    .promotions-description {
        font-size: 18px;
    }
    
    .card-image {
        padding-bottom: 75%; /* Maintain aspect ratio */
    }
    
    .product-title {
        font-size: 18px;
        min-height: 54px;
    }
}

/* TABLET PORTRAIT: 2 columns (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .products-grid.columns-4,
    .products-grid.columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .free-delivery-promotions-page {
        padding: 35px 15px;
    }
    
    .promotions-title {
        font-size: 32px;
    }
    
    .promotions-description {
        font-size: 17px;
        margin-bottom: 40px;
    }
    
    .card-image {
        padding-bottom: 80%; /* Slightly taller on tablets */
    }
    
    .card-content {
        padding: 20px;
    }
    
    .product-title {
        font-size: 17px;
        min-height: 48px;
    }
    
    .product-price {
        font-size: 22px;
    }
    
    .view-product-btn, .add-to-cart-btn {
        padding: 14px 15px;
        font-size: 14px;
        min-width: 120px;
    }
}

/* MOBILE LANDSCAPE: 2 columns (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .products-grid.columns-4,
    .products-grid.columns-3,
    .products-grid.columns-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .free-delivery-promotions-page {
        padding: 30px 15px;
    }
    
    .promotions-title {
        font-size: 28px;
        padding-bottom: 15px;
    }
    
    .promotions-description {
        font-size: 16px;
        margin-bottom: 35px;
    }
    
    /* MOBILE IMAGE FIX: Perfect aspect ratio */
    .card-image {
        padding-bottom: 85%; /* Slightly taller for mobile */
    }
    
    .offer-badge {
        top: 15px;
        right: 15px;
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .product-title {
        font-size: 16px;
        min-height: 44px;
    }
    
    .product-price {
        font-size: 20px;
    }
    
    .eligibility-info {
        padding: 15px;
    }
    
    .card-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .view-product-btn, .add-to-cart-btn {
        width: 100%;
        min-width: 0;
        padding: 14px;
        font-size: 14px;
    }
}

/* MOBILE PORTRAIT: 1 column (480px to 575px) */
@media (min-width: 480px) and (max-width: 575px) {
    .products-grid.columns-4,
    .products-grid.columns-3,
    .products-grid.columns-2 {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .free-delivery-promotions-page {
        padding: 25px 12px;
    }
    
    .promotions-title {
        font-size: 26px;
    }
    
    .promotions-description {
        font-size: 15px;
        margin-bottom: 30px;
    }
    
    /* MOBILE PORTRAIT IMAGE FIX */
    .card-image {
        padding-bottom: 90%; /* Taller for single column */
    }
    
    .card-content {
        padding: 20px;
    }
    
    .product-title {
        font-size: 18px;
        min-height: auto;
    }
    
    .view-product-btn, .add-to-cart-btn {
        padding: 15px;
        font-size: 15px;
    }
    
    /* MOBILE BUTTON FIX */
    .card-actions {
        flex-direction: column;
    }
}

/* SMALL MOBILE: 1 column (320px to 479px) */
@media (min-width: 320px) and (max-width: 479px) {
    .products-grid.columns-4,
    .products-grid.columns-3,
    .products-grid.columns-2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .free-delivery-promotions-page {
        padding: 20px 10px;
    }
    
    .promotions-title {
        font-size: 24px;
    }
    
    .promotions-description {
        font-size: 14px;
        margin-bottom: 25px;
    }
    
    /* SMALL MOBILE IMAGE FIX */
    .card-image {
        padding-bottom: 95%; /* Even taller for small mobile */
    }
    
    .card-content {
        padding: 15px;
    }
    
    .product-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .product-price {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .eligibility-info {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .min-quantity, .payment-method {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .value {
        align-self: flex-start;
        padding: 6px 12px;
        font-size: 18px;
    }
    
    /* SMALL MOBILE BUTTON FIX */
    .card-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .view-product-btn, .add-to-cart-btn {
        padding: 14px;
        font-size: 14px;
        width: 100%;
    }
}

/* EXTRA SMALL MOBILE: 1 column (below 320px) */
@media (max-width: 319px) {
    .products-grid.columns-4,
    .products-grid.columns-3,
    .products-grid.columns-2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .free-delivery-promotions-page {
        padding: 15px 8px;
    }
    
    .promotions-title {
        font-size: 22px;
    }
    
    .promotions-description {
        font-size: 13px;
    }
    
    /* EXTRA SMALL MOBILE IMAGE FIX */
    .card-image {
        padding-bottom: 100%; /* Square aspect ratio */
    }
    
    .card-content {
        padding: 12px;
    }
    
    .product-title {
        font-size: 15px;
    }
    
    .view-product-btn, .add-to-cart-btn {
        padding: 12px;
        font-size: 13px;
    }
}

/* ============================================
   CHECKOUT MESSAGE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .free-delivery-checkout-message,
    .free-delivery-message {
        font-size: 16px !important;
        padding: 20px 25px !important;
        margin-bottom: 30px !important;
    }
}

@media (max-width: 480px) {
    .free-delivery-checkout-message,
    .free-delivery-message {
        font-size: 15px !important;
        padding: 18px 20px !important;
        margin-bottom: 25px !important;
    }
}

/* ============================================
   WOOCOMMERCE OVERRIDES
   ============================================ */
.woocommerce-message.free-delivery-checkout-message,
.woocommerce-message.free-delivery-message {
    border: none !important;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    color: var(--white) !important;
    border-left: none !important;
}

/* ============================================
   ADD TO CART BUTTON FIX - IMPORTANT
   ============================================ */
/* Remove any conflicting WooCommerce styles */
a.add-to-cart-btn.button {
    display: inline-block !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

/* Fix for button click issues */
a.add-to-cart-btn,
a.add-to-cart-btn:hover,
a.add-to-cart-btn:focus,
a.add-to-cart-btn:active {
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Ensure buttons are properly sized on mobile */
@media (max-width: 767px) {
    .add-to-cart-btn {
        display: block !important;
        width: 100% !important;
        margin: 5px 0 !important;
        text-align: center !important;
    }
}

/* Touch-friendly button sizes for mobile */
@media (max-width: 480px) {
    .add-to-cart-btn {
        min-height: 44px !important; /* Apple's recommended minimum touch target */
        line-height: 44px !important;
        padding: 0 20px !important;
    }
}

/* Loading state for AJAX add to cart */
.add-to-cart-btn.loading {
    position: relative;
    color: transparent !important;
}

.add-to-cart-btn.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}