/**
 * Frequently Bought Together - Frontend Styles
 * 
 * This file contains all frontend styles for the FBT section.
 * Inline styles in the template are kept for quick loading,
 * but this file provides additional styling and overrides.
 */

/* Base Section Styles */
.frequently-bought-together-section {
    position: relative;
}

.fbt-container {
    position: relative;
}

/* Grid System */
.fbt-products-grid {
    display: grid;
    gap: 20px;
    align-items: stretch;
}

/* Product Card */
.fbt-product-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fbt-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Product Image */
.fbt-product-image {
    position: relative;
    overflow: hidden;
}

.fbt-product-image a {
    display: block;
    transition: transform 0.3s ease;
}

.fbt-product-item:hover .fbt-product-image a {
    transform: scale(1.05);
}

.fbt-product-image img {
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

/* Sale Badge */
.fbt-sale-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e74c3c;
    color: #fff;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

/* Product Title */
.fbt-product-name {
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 8px;
    font-weight: 500;
}

.fbt-product-name a {
    color: inherit;
    text-decoration: none;
}

.fbt-product-name a:hover {
    color: #0073aa;
}

/* Price */
.fbt-product-price {
    margin-bottom: 12px;
}

.fbt-product-price .amount {
    font-weight: 600;
}

.fbt-product-price ins {
    text-decoration: none;
    color: #e74c3c;
    font-weight: 700;
}

.fbt-product-price del {
    color: #999;
    font-size: 0.9em;
    font-weight: 400;
}

/* Add to Cart Button */
.fbt-add-to-cart {
    margin-top: auto;
}

.fbt-add-to-cart button,
.fbt-add-to-cart a {
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

.fbt-add-to-cart button:hover,
.fbt-add-to-cart a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.fbt-add-to-cart button:active,
.fbt-add-to-cart a:active {
    transform: translateY(0);
}

/* Button States */
.fbt-add-to-cart button.added {
    background: #4CAF50 !important;
}

.fbt-add-to-cart button .fbt-loading {
    display: none;
}

.fbt-add-to-cart button.loading .fbt-add-text {
    display: none;
}

.fbt-add-to-cart button.loading .fbt-loading {
    display: inline-block;
}

/* Out of Stock */
.fbt-out-of-stock {
    padding: 12px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 4px;
    color: #666;
    font-size: 13px;
    font-weight: 500;
}

/* Notice Styles */
.fbt-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    animation: fbtSlideDown 0.3s ease;
}

@keyframes fbtSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fbt-notice.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fbt-notice.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.fbt-notice .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.fbt-notice-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.fbt-notice-close:hover {
    opacity: 1;
}

/* Responsive Breakpoints */

/* Large Tablets and Small Desktops */
@media (max-width: 1200px) {
    .fbt-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets */
@media (max-width: 992px) {
    .fbt-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .fbt-heading {
        font-size: 22px;
    }
}

/* Large Phones */
@media (max-width: 768px) {
    .fbt-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .fbt-heading {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .frequently-bought-together-section {
        margin: 30px 0;
        padding: 20px 0;
    }
    
    .fbt-product-name {
        font-size: 13px;
    }
    
    .fbt-add-to-cart button,
    .fbt-add-to-cart a {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    .fbt-products-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .fbt-heading {
        font-size: 18px;
    }
    
    .fbt-product-image img {
        max-height: 150px;
    }
    
    .fbt-product-info {
        padding: 12px;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .fbt-product-item {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print Styles */
@media print {
    .frequently-bought-together-section {
        display: none;
    }
}