/**
 * YITH Product Brands Custom Styling
 * Version: 1.0.0
 */

/* ===================================
   Brand Archive Page Header
   =================================== */
.yith-wcbr-brands-header-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px;
    margin: 40px auto;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

.yith-wcbr-brands-header-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,115,170,0.03) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.yith-wcbr-brands-header-wrapper img {
    max-width: 250px;
    height: auto;
    display: inline-block;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

/* ===================================
   Product Grid Layout
   =================================== */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
    padding: 0;
    list-style: none;
}

.woocommerce ul.products li.product {
    background: #ffffff;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.woocommerce ul.products li.product::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0073aa, #27ae60);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    transform: translateY(-5px);
    border-color: #0073aa;
}

.woocommerce ul.products li.product:hover::before {
    transform: scaleX(1);
}

/* ===================================
   Product Image Styling
   =================================== */
.woocommerce ul.products li.product .et_shop_image {
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    background: #f8f9fa;
}

.woocommerce ul.products li.product .et_shop_image::after {
    content: 'View Product';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,115,170,0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.woocommerce ul.products li.product:hover .et_shop_image::after {
    opacity: 1;
}

.woocommerce ul.products li.product img {
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
    display: block;
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.08);
}

/* ===================================
   Product Title
   =================================== */
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 17px;
    line-height: 1.4;
    margin: 15px 0;
    min-height: 48px;
    font-weight: 600;
    color: #2c3e50;
    transition: color 0.3s ease;
}

.woocommerce ul.products li.product:hover h2,
.woocommerce ul.products li.product:hover .woocommerce-loop-product__title {
    color: #0073aa;
}

/* ===================================
   Price Styling
   =================================== */
.woocommerce ul.products li.product .price {
    font-size: 24px;
    font-weight: bold;
    color: #27ae60;
    margin: 15px 0;
    display: block;
}

.woocommerce ul.products li.product .price .woocommerce-Price-amount {
    display: inline-block;
    animation: none;
}

.woocommerce ul.products li.product:hover .price .woocommerce-Price-amount {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===================================
   Brand Information in Product Loop
   =================================== */
.woocommerce ul.products li.product .yith-wcbr-brands {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    transition: background 0.3s ease;
}

.woocommerce ul.products li.product:hover .yith-wcbr-brands {
    background: #e8f4fd;
}

.woocommerce ul.products li.product .yith-wcbr-brands a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: all 0.3s ease;
    position: relative;
}

.woocommerce ul.products li.product .yith-wcbr-brands a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #0073aa;
    transition: width 0.3s ease;
}

.woocommerce ul.products li.product .yith-wcbr-brands a:hover::after {
    width: 100%;
}

/* ===================================
   Brand Logo in Product Grid
   =================================== */
.woocommerce ul.products li.product .yith-wcbr-brands-logo {
    display: block;
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #e0e0e0;
}

.woocommerce ul.products li.product .yith-wcbr-brands-logo img {
    max-width: 90px;
    height: auto;
    opacity: 0.7;
    transition: all 0.3s ease;
    filter: grayscale(20%);
}

.woocommerce ul.products li.product:hover .yith-wcbr-brands-logo img {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
}

/* ===================================
   Affirm Payment Information
   =================================== */
.affirm-as-low-as {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    padding: 12px;
    background: linear-gradient(135deg, #f7f9fc 0%, #e8f4f8 100%);
    border-radius: 8px;
    margin-top: 15px;
    border-left: 3px solid #0073aa;
}

.affirm-as-low-as .affirm-modal-trigger {
    color: #0073aa;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.affirm-as-low-as .affirm-modal-trigger:hover {
    color: #005177;
    text-decoration: underline;
}

/* ===================================
   Pagination
   =================================== */
.woocommerce-pagination {
    margin: 50px 0;
    text-align: center;
}

.woocommerce-pagination ul.page-numbers {
    display: inline-flex;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background: #ffffff;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
    font-weight: 500;
}

.woocommerce-pagination .page-numbers:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,115,170,0.3);
}

.woocommerce-pagination .page-numbers.current {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 3px 10px rgba(0,115,170,0.3);
}

.woocommerce-pagination .next,
.woocommerce-pagination .prev {
    font-weight: bold;
}

/* ===================================
   Result Count and Ordering
   =================================== */
.woocommerce-result-count {
    float: left;
    margin: 25px 0;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.woocommerce-ordering {
    float: right;
    margin: 25px 0;
}

.woocommerce-ordering select {
    padding: 12px 40px 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff url('data:image/svg+xml;utf8,<svg fill="%23333" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 15px center;
    background-size: 20px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    font-weight: 500;
    min-width: 200px;
}

.woocommerce-ordering select:hover {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.woocommerce-ordering select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.2);
}

/* ===================================
   Breadcrumb Navigation
   =================================== */
.woocommerce-breadcrumb {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 15px 25px;
    border-radius: 8px;
    margin-bottom: 35px;
    font-size: 14px;
    color: #666;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.woocommerce-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.woocommerce-breadcrumb a:hover {
    color: #005177;
}

/* ===================================
   Page Title
   =================================== */
.woocommerce-products-header__title {
    font-size: 42px;
    color: #2c3e50;
    text-align: center;
    margin: 30px 0;
    font-weight: 700;
    position: relative;
    letter-spacing: -0.5px;
}

.woocommerce-products-header__title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #0073aa, #27ae60);
    margin: 20px auto 0;
    border-radius: 2px;
}

/* ===================================
   Brand Description
   =================================== */
.term-description {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    border-left: 4px solid #0073aa;
}

/* ===================================
   Clear Floats
   =================================== */
.woocommerce-notices-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* ===================================
   Layout Container
   =================================== */
#left-area {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ===================================
   Remove Default WooCommerce Columns
   =================================== */
.woocommerce ul.products li.product.first,
.woocommerce ul.products li.product.last {
    clear: none !important;
    margin: 0 !important;
}

.woocommerce ul.products.columns-3 li.product,
.woocommerce ul.products.columns-4 li.product,
.woocommerce ul.products.columns-2 li.product,
.woocommerce ul.products.columns-5 li.product,
.woocommerce ul.products.columns-6 li.product {
    width: auto !important;
    float: none !important;
    margin: 0 !important;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1200px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .woocommerce-products-header__title {
        font-size: 32px;
    }

    .yith-wcbr-brands-header-wrapper {
        padding: 25px;
        margin: 25px auto;
    }

    .woocommerce-result-count,
    .woocommerce-ordering {
        float: none;
        width: 100%;
        margin: 15px 0;
    }

    .woocommerce-ordering select {
        width: 100%;
    }

    #left-area {
        padding: 0 20px;
    }

    .woocommerce ul.products li.product {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .woocommerce ul.products li.product {
        padding: 20px;
    }

    .woocommerce-products-header__title {
        font-size: 26px;
    }

    .yith-wcbr-brands-header-wrapper {
        padding: 20px;
        margin: 20px auto;
    }

    .yith-wcbr-brands-header-wrapper img {
        max-width: 180px;
    }

    .woocommerce-pagination .page-numbers {
        min-width: 35px;
        height: 35px;
        padding: 0 10px;
        font-size: 14px;
    }
}

/* ===================================
   Animation Classes
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.woocommerce ul.products li.product {
    animation: fadeIn 0.5s ease forwards;
}

.woocommerce ul.products li.product:nth-child(1) { animation-delay: 0.1s; }
.woocommerce ul.products li.product:nth-child(2) { animation-delay: 0.2s; }
.woocommerce ul.products li.product:nth-child(3) { animation-delay: 0.3s; }
.woocommerce ul.products li.product:nth-child(4) { animation-delay: 0.4s; }
.woocommerce ul.products li.product:nth-child(5) { animation-delay: 0.5s; }
.woocommerce ul.products li.product:nth-child(6) { animation-delay: 0.6s; }

/* ===================================
   Additional Hover Effects
   =================================== */
.woocommerce ul.products li.product a {
    text-decoration: none;
    color: inherit;
}

.woocommerce ul.products li.product .et_overlay {
    display: none;
}

/* Brand Archive Specific Body Class */
body.yith-brand-archive {
    background: #f5f7fa;
}

body.yith-brand-archive #main-content {
    padding-top: 40px;
    padding-bottom: 60px;
}