/* HiddenTechies Free Gift Plugin - Frontend Styles */
/* Designed to match Alukas theme */

/* Gift Offers Container */
.htfg-gift-offers {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: var(--pls-border-radius, 8px);
    padding: 30px;
    margin: 25px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.htfg-gift-offers::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--pls-primary-color, #a07936);
}

/* Countdown Timer */
.htfg-countdown {
    background: var(--pls-primary-color, #a07936);
    color: white;
    padding: 15px 20px;
    border-radius: var(--pls-border-radius, 8px);
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(160, 121, 54, 0.2);
    border: none;
}

.htfg-countdown-text {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.htfg-countdown-timer {
    font-size: 24px;
    font-weight: 600;
    font-family: var(--pls-primary-font, inherit);
}

.htfg-countdown-minutes,
.htfg-countdown-seconds {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 8px;
    border-radius: 4px;
    margin: 0 2px;
}

/* Gift Offers Header */
.htfg-gift-offers-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--pls-primary-color, #a07936);
    border-radius: var(--pls-border-radius, 8px);
    color: white;
    position: relative;
}

.htfg-gift-offers-title {
    font-size: 28px;
    font-weight: 600;
    color: white;
    margin: 0 0 15px 0;
    font-family: var(--pls-primary-font, inherit);
}

.htfg-gift-offers-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.6;
    font-weight: 400;
}

/* Gift Offers Grid - Inline Layout */
.htfg-gift-offers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}

/* Gift Card */
.htfg-gift-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: var(--pls-border-radius, 8px);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 350px;
}

.htfg-gift-card::before {
    content: 'FREE GIFT';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--pls-primary-color, #a07936);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.htfg-gift-card:hover {
    border-color: var(--pls-primary-color, #a07936);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.htfg-gift-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.htfg-gift-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.htfg-gift-card:hover .htfg-gift-card-image img {
    transform: scale(1.05);
}

.htfg-gift-card-content {
    padding: 20px;
}

.htfg-gift-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--pls-link-color, #333);
    margin: 0 0 15px 0;
    line-height: 1.3;
    font-family: var(--pls-primary-font, inherit);
}

/* Gift Card Price */
.htfg-gift-card-price {
    margin-bottom: 15px;
}

.htfg-original-price {
    text-decoration: line-through;
    color: #7f8c8d;
    font-size: 14px;
    margin-right: 10px;
}

.htfg-free-price {
    background: var(--pls-primary-color, #a07936);
    color: white;
    padding: 6px 12px;
    border-radius: var(--pls-border-radius, 6px);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin: 2px 0;
    box-shadow: 0 2px 4px rgba(160, 121, 54, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ensure FREE label only shows in subtotal column, not in price column */
.woocommerce-cart-form__cart-item .product-price .htfg-free-price,
.cart_item .product-price .htfg-free-price {
    display: none;
}

/* Show FREE label only in subtotal column */
.woocommerce-cart-form__cart-item .product-subtotal .htfg-free-price,
.cart_item .product-subtotal .htfg-free-price {
    display: inline-block;
}

/* Gift Card Details */
.htfg-gift-card-details {
    margin-bottom: 20px;
}

.htfg-gift-card-details p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--pls-text-color, #666);
}

.htfg-min-amount {
    font-weight: 600;
    color: var(--pls-primary-color, #a07936);
}

.htfg-remaining-quantity {
    color: #27ae60;
    font-weight: 500;
}

.htfg-max-reached {
    color: #e74c3c;
    font-weight: 500;
}

/* Add Button - Match theme button styles */
.htfg-add-btn {
    background-color: var(--pls-button-bg-color, var(--pls-primary-color, #a07936));
    color: var(--pls-button-color, white);
    border: 0;
    border-radius: var(--pls-border-radius, 8px);
    cursor: pointer;
    display: inline-block;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    padding: 10px 30px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    width: 100%;
    text-transform: none;
    letter-spacing: normal;
    position: relative;
    overflow: hidden;
    font-family: var(--pls-primary-font, inherit);
}

.htfg-add-btn::before {
    content: '🎁 ';
    margin-right: 8px;
    font-size: 16px;
}

.htfg-add-btn:hover:not(:disabled) {
    background-color: var(--pls-button-bg-hover-color, #8b6b2e);
    color: var(--pls-button-hover-color, white);
    transform: translateY(-1px);
}

.htfg-add-btn:active {
    transform: translateY(0);
}

.htfg-add-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.htfg-add-btn:disabled::before {
    content: '❌ ';
}

/* Variation Select */
.htfg-variation-select {
    margin-bottom: 15px;
}

.htfg-variation-select label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pls-link-color, #333);
    margin-bottom: 8px;
    font-family: var(--pls-primary-font, inherit);
}

.htfg-variation-select-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e1e5e9;
    border-radius: var(--pls-border-radius, 8px);
    font-size: 14px;
    background: #fff;
    transition: all 0.3s ease;
    font-family: var(--pls-primary-font, inherit);
}

.htfg-variation-select-field:focus {
    outline: none;
    border-color: var(--pls-primary-color, #a07936);
    box-shadow: 0 0 0 2px rgba(160, 121, 54, 0.1);
}

/* Messages */
.htfg-messages {
    margin-top: 20px;
}

.htfg-success-message,
.htfg-error-message {
    padding: 15px 20px;
    border-radius: var(--pls-border-radius, 8px);
    font-weight: 500;
    margin-bottom: 10px;
    font-family: var(--pls-primary-font, inherit);
}

.htfg-success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.htfg-error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Gift Messages */
.htfg-message-container {
    margin: 20px 0;
}

.htfg-close-message {
    background: var(--pls-primary-color, #a07936);
    color: white;
    padding: 15px 20px;
    border-radius: var(--pls-border-radius, 8px);
    text-align: center;
    font-weight: 500;
    margin: 20px 0;
    font-family: var(--pls-primary-font, inherit);
}

.htfg-eligible-message {
    background: var(--pls-primary-color, #a07936);
    color: white;
    padding: 15px 20px;
    border-radius: var(--pls-border-radius, 8px);
    text-align: center;
    font-weight: 500;
    font-family: var(--pls-primary-font, inherit);
}

.htfg-amount-needed-message {
    background: #ffc107;
    color: #212529;
    padding: 15px 20px;
    border-radius: var(--pls-border-radius, 8px);
    text-align: center;
    font-weight: 500;
    margin: 20px 0;
    font-family: var(--pls-primary-font, inherit);
}

/* Gift Badge */
.htfg-gift-badge {
    background: var(--pls-primary-color, #a07936);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

/* Loading States */
.htfg-loading {
    opacity: 0.6;
    pointer-events: none;
}

.htfg-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--pls-primary-color, #a07936);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation for new elements */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.htfg-gift-card {
    animation: slideInUp 0.4s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .htfg-gift-offers {
        padding: 20px;
        margin: 15px 0;
    }
    
    .htfg-gift-offers-title {
        font-size: 24px;
    }
    
    .htfg-gift-offers-description {
        font-size: 14px;
    }
    
    .htfg-gift-offers-grid {
        flex-direction: column;
        gap: 15px;
    }
    
    .htfg-gift-card {
        min-width: auto;
        max-width: none;
    }
    
    .htfg-gift-card-content {
        padding: 15px;
    }
    
    .htfg-gift-card-title {
        font-size: 16px;
    }
    
    .htfg-add-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .htfg-countdown-timer {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .htfg-gift-offers {
        padding: 15px;
    }
    
    .htfg-gift-offers-title {
        font-size: 20px;
    }
    
    .htfg-gift-offers-grid {
        gap: 12px;
    }
    
    .htfg-gift-card-image {
        height: 150px;
    }
    
    .htfg-gift-card-content {
        padding: 12px;
    }
    
    .htfg-add-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .htfg-countdown {
        padding: 12px 15px;
    }
    
    .htfg-countdown-timer {
        font-size: 18px;
    }
}

/* WooCommerce Integration */
.woocommerce-cart .htfg-gift-offers,
.woocommerce-checkout .htfg-gift-offers {
    margin: 20px 0;
}

.woocommerce-cart .htfg-close-message,
.woocommerce-checkout .htfg-close-message {
    margin: 15px 0;
}

/* Cart Item Gift Badge */
.woocommerce-cart .htfg-gift-badge {
    display: inline-block;
    vertical-align: middle;
}

/* Gift Removal Button */
.htfg-gift-removal {
    margin-top: 10px;
}

.htfg-remove-gift-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--pls-border-radius, 8px);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: var(--pls-primary-font, inherit);
}

.htfg-remove-gift-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.htfg-remove-gift-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.htfg-remove-gift-btn .htfg-gift-badge {
    background: var(--pls-primary-color, #a07936);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
}

/* Form Styling */
.htfg-gift-form {
    margin-top: 15px;
}

.htfg-gift-form .htfg-add-btn {
    margin-top: 10px;
}

/* Enhanced Focus States */
.htfg-add-btn:focus,
.htfg-variation-select-field:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(160, 121, 54, 0.2);
}

/* Print Styles */
@media print {
    .htfg-gift-offers {
        border: 1px solid #ccc;
        box-shadow: none;
    }
    
    .htfg-add-btn {
        display: none;
    }
    
    .htfg-countdown {
        display: none;
    }
}

/* Theme-specific overrides for better integration */
.woocommerce .htfg-gift-offers {
    background: #fff;
    border: 1px solid #e1e5e9;
}

.woocommerce .htfg-add-btn {
    background-color: var(--pls-button-bg-color, var(--pls-primary-color, #a07936));
    color: var(--pls-button-color, white);
}

.woocommerce .htfg-add-btn:hover {
    background-color: var(--pls-button-bg-hover-color, #8b6b2e);
    color: var(--pls-button-hover-color, white);
}

/* Ensure consistent spacing with WooCommerce elements */
.woocommerce-cart .htfg-gift-offers {
    margin: 20px 0;
}

.woocommerce-checkout .htfg-gift-offers {
    margin: 20px 0;
}

/* Mini Cart Message Styling */
.widget_shopping_cart .htfg-message-container {
    margin: 10px 0;
    padding: 0 10px;
}

.widget_shopping_cart .htfg-eligible-message,
.widget_shopping_cart .htfg-amount-needed-message {
    padding: 8px 12px;
    font-size: 12px;
    margin: 5px 0;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

.widget_shopping_cart .htfg-eligible-message {
    background: var(--pls-primary-color, #a07936);
    color: white;
}

.widget_shopping_cart .htfg-amount-needed-message {
    background: #ffc107;
    color: #212529;
}

/* Mini Cart Container Adjustments */
.widget_shopping_cart .woocommerce-mini-cart {
    margin-top: 10px;
}

/* Ensure mini cart messages don't interfere with cart items */
.widget_shopping_cart .htfg-message-container:first-child {
    margin-top: 0;
}

.widget_shopping_cart .htfg-message-container:last-child {
    margin-bottom: 0;
}

/* Hardcoded Message - Alukus Theme Style */
.htfg-hardcoded-message {
    background: linear-gradient(135deg, var(--pls-primary-color, #a07936) 0%, #8b6b2e 100%);
    border: 2px solid var(--pls-primary-color, #a07936);
    padding: 20px;
    margin: 15px 0;
    border-radius: var(--pls-border-radius, 8px);
    text-align: center;
    font-weight: 600;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(160, 121, 54, 0.3);
    position: relative;
    overflow: hidden;
    font-family: var(--pls-primary-font, inherit);
}

.htfg-hardcoded-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}
