/*
Theme Name: Bryan Shoes
Theme URI: https://bryanshoes.id
Author: Senior WP Developer
Author URI: https://bryanshoes.id
Description: Premium, elegant, and ultra-fast WooCommerce theme tailored specifically for women's shoe e-commerce. Built with Bootstrap 5.3, Vanilla JS, and optimized for Core Web Vitals, Security, and SEO.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.5
Requires PHP: 8.0
Text Domain: bryanshoes-theme
Tags: e-commerce, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, woocommerce, bootstrap, luxury, fashion, fast-loading, white-space

License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================

CSS Variables (Customizer Ready & Luxury Theme Foundation)
========================================================================== */
:root {
    /* Typography */
    --bs-font-sans-serif: 'Jost',
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
    --bs-font-serif: 'Playfair Display',
        Georgia,
        serif;

    /* Brand Colors - Soft, Elegant, Luxury */
    --bs-primary: #C5A880;
    /* Soft Gold / Nude */
    --bs-primary-rgb: 197,
        168,
        128;
    --bs-secondary: #2C2C2C;
    /* Deep Charcoal / Near Black */
    --bs-secondary-rgb: 44,
        44,
        44;

    /* Body Colors */
    --bs-body-color: #555555;
    --bs-body-bg: #FAFAFA;
    /* Soft off-white for wide spacing */

    /* Utility Colors */
    --bs-border-color: #EAEAEA;
    --bs-gray-100: #F7F7F7;
    --bs-gray-200: #EAEAEA;
    --bs-gray-900: #1A1A1A;

    /* Transitions */
    --bs-transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Shadow */
    --bs-box-shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.03);
    --bs-box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    --bs-box-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.08);

    /* Header Heights for Padding */
    --header-height-desktop: 155px;
    --header-height-mobile: 80px;
}

/* ==========================================================================
2. Core WordPress Classes (Mandatory for WP Themes)
========================================================================== */
.alignnone {
    margin: 5px 20px 20px 0;
}

.aligncenter,
div.aligncenter {
    display: block;
    margin: 5px auto 5px auto;
}

.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}

.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}

a img.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}

a img.alignnone {
    margin: 5px 20px 20px 0;
}

a img.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}

a img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    max-width: 100%;
    padding: 5px 3px 10px;
    text-align: center;
}

.wp-caption.alignnone {
    margin: 5px 20px 20px 0;
}

.wp-caption.alignleft {
    margin: 5px 20px 20px 0;
}

.wp-caption.alignright {
    margin: 5px 0 20px 20px;
}

.wp-caption img {
    border: 0 none;
    height: auto;
    margin: 0;
    max-width: 98.5%;
    padding: 0;
    width: auto;
}

.wp-caption p.wp-caption-text {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    padding: 0 4px 5px;
    color: var(--bs-body-color);
}

/* Screen Readers Only */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--bs-gray-100);
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: var(--bs-secondary);
    display: block;
    font-size: 0.875rem;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
3. Global Resets & Typography Base
========================================================================== */
body {
    font-family: var(--bs-font-sans-serif);
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: var(--bs-font-serif);
    color: var(--bs-gray-900);
    font-weight: 500;
    line-height: 1.3;
}

a {
    color: var(--bs-secondary);
    text-decoration: none;
    transition: var(--bs-transition-smooth);
}

a:hover {
    color: var(--bs-primary);
}

/* ==========================================================================
4. Header & Navigation Fixes (New Additions)
========================================================================== */

/* Fix Content Overlap caused by Fixed Header */
.site-content {
    padding-top: var(--header-height-mobile);
}

@media (min-width: 992px) {
    .site-content {
        padding-top: var(--header-height-desktop);
    }
}

/* Smooth Header & Logo Shrink Transition */
.site-header {
    transition: transform 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

.site-header .custom-logo {
    transition: max-height 0.3s ease;
    max-height: 60px;
    /* Default Logo Height */
    width: auto;
}

.header-scrolled .custom-logo {
    max-height: 40px !important;
    /* Shrinked Logo Height */
}

.header-scrolled .main-header {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Animasi untuk logo saat di-scroll */
.logo-shrink {
    transform: scale(0.85);
}

/* Fix: The "Invisible Bridge" untuk Hover Dropdown agar tidak terputus/hilang saat disorot */
.hover-dropdown .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    /* Jembatan tak terlihat ke atas setinggi 10px */
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
    z-index: 999;
}

/* Hover Dropdowns (Desktop Only) */
@media (min-width: 992px) {
    .hover-dropdown:hover>.dropdown-menu {
        display: block;
        animation: fadeInDown 0.3s ease forwards;
    }

    /* Dropend for Submenu Level 2+ */
    .dropdown-menu .dropend:hover>.dropdown-submenu {
        display: block;
        top: 0;
        left: 100%;
        margin-top: -0.5rem;
        margin-left: 0.125rem;
        animation: fadeInLeft 0.3s ease forwards;
    }

    /* Caret pointing right for dropends */
    .dropdown-menu .dropend>.dropdown-toggle::after {
        border-top: 0.3em solid transparent;
        border-bottom: 0.3em solid transparent;
        border-left: 0.3em solid;
        margin-left: auto;
        vertical-align: middle;
    }

    .dropdown-menu .dropend>.dropdown-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }


}

/* Mobile Menu Accordion Styles (Fix for Popper.js Conflict) */
.mobile-navigation .dropdown-menu {
    position: static !important;
    float: none;
    width: 100%;
    box-shadow: none !important;
    border: none !important;
    border-left: 2px solid var(--bs-gray-200) !important;
    padding-left: 1rem;
    transform: none !important;
    background-color: transparent !important;
    margin-top: 0.5rem;
}

.mobile-navigation .dropdown-menu.show {
    display: block;
    animation: fadeInDown 0.3s ease forwards;
}

@media (max-width: 991.98px) {
    .mobile-nav-accordion .dropdown-menu {
        position: static !important;
        /* Hapus posisi melayang (absolute) */
        transform: none !important;
        float: none;
        border: none;
        padding-left: 1rem;
        margin-top: 0;
        box-shadow: none !important;
        background-color: #f8f9fa;
        /* Beri warna sedikit berbeda agar terlihat berhierarki */
    }

    .mobile-nav-accordion .dropdown-item {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

/* Dropdown Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* WooCommerce Mini Cart Overrides for Bootstrap */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons .button {
    flex: 1;
    text-align: center;
    border-radius: 0;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons .checkout {
    background-color: var(--bs-dark);
    color: #fff;
}

/* List Keranjang */
.widget_shopping_cart_content ul.cart_list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
    /* Jika produk sangat banyak, bisa di-scroll di dalam kotak */
}

/* Tata letak fleksibel (Flexbox) untuk tiap produk di keranjang */
.widget_shopping_cart_content ul.cart_list li {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    margin: 0;
    position: relative;
}

/* Hapus garis di produk terakhir */
.widget_shopping_cart_content ul.cart_list li:last-child {
    border-bottom: none;
}

/* FIX GAMBAR RAKSASA: Memaksa ukuran gambar produk menjadi kecil (Thumbnail) */
.widget_shopping_cart_content ul.cart_list li img {
    width: 60px !important;
    height: 75px !important;
    /* Aspect ratio yang sesuai dengan foto fesyen */
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin: 0 15px 0 0 !important;
    float: none !important;
}

/* Teks dan Info Produk */
.widget_shopping_cart_content ul.cart_list li .product-details {
    flex-grow: 1;
    padding-right: 25px;
    /* Jarak untuk tombol X */
}

.widget_shopping_cart_content ul.cart_list li a:not(.remove) {
    font-weight: 600;
    text-decoration: none;
    color: #212529;
    display: block;
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 4px;
}

.widget_shopping_cart_content ul.cart_list li a:not(.remove):hover {
    color: #666;
}

/* Harga & Kuantitas */
.widget_shopping_cart_content ul.cart_list li .quantity {
    font-size: 0.85rem;
    color: #6c757d;
    display: block;
}

/* Tombol Hapus (X) */
.widget_shopping_cart_content ul.cart_list li a.remove {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f8f9fa;
    color: #dc3545 !important;
    font-size: 1.2rem;
    line-height: 1;
    text-decoration: none;
    transition: all 0.2s;
}

.widget_shopping_cart_content ul.cart_list li a.remove:hover {
    background: #dc3545;
    color: #fff !important;
}

/* Total Harga Area */
.widget_shopping_cart_content .total {
    padding: 15px;
    background-color: #fafafa;
    border-top: 1px solid #eee;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget_shopping_cart_content .total strong {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #666;
}

.widget_shopping_cart_content .total .amount {
    font-weight: 700;
    color: #212529;
    font-size: 1.1rem;
}

/* Tombol Aksi (View Cart & Checkout) */
.widget_shopping_cart_content .buttons {
    padding: 15px;
    margin: 0;
    display: flex;
    gap: 10px;
}

.widget_shopping_cart_content .buttons a {
    flex: 1;
    display: block;
    text-align: center;
    padding: 10px 5px;
    border-radius: 0;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.3s;
}

/* Tombol View Cart */
.widget_shopping_cart_content .buttons a.button:not(.checkout) {
    background-color: #fff;
    color: #212529;
    border: 1px solid #dee2e6;
}

.widget_shopping_cart_content .buttons a.button:not(.checkout):hover {
    background-color: #f8f9fa;
    border-color: #c1c1c1;
}

/* Tombol Checkout */
.widget_shopping_cart_content .buttons a.checkout {
    background-color: #212529;
    color: #fff;
    border: 1px solid #212529;
}

.widget_shopping_cart_content .buttons a.checkout:hover {
    background-color: #000;
}

/* Pesan Keranjang Kosong */
.widget_shopping_cart_content .woocommerce-mini-cart__empty-message {
    padding: 30px 15px;
    text-align: center;
    color: #6c757d;
    margin: 0;
    font-size: 0.95rem;
}

/* ------------------------------------------------------------------------- *
 * 4. WOOCOMMERCE MISC OVERRIDES
 * ------------------------------------------------------------------------- */
/* Styling tombol Add to cart loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.woocommerce-product-gallery__trigger {
    display: none !important;
    /* Hapus lightbox trigger bawaan karena kita pakai Bootstrap Modal */
}

/* Memperbaiki tinggi konten halaman agar footer selalu di bawah (Sticky Footer UX) */
#page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#content {
    flex: 1;
}

/* ------------------------------------------------------------------------- *

RESPONSIVE OVERRIDES (CUSTOMIZER SYNC)

------------------------------------------------------------------------- /
/* Override untuk Mobile: 1 Kolom Full Width */
.product-tabs-responsive-grid.mobile-col-1 .product-card-wrapper {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Override untuk Mobile: 2 Kolom Grid */
.product-tabs-responsive-grid.mobile-col-2 .product-card-wrapper {
    flex: 0 0 50% !important;
    max-width: 50% !important;
}

/* Override khusus Tablet (Layar menengah 768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .product-tabs-responsive-grid.tablet-col-2 .product-card-wrapper {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .product-tabs-responsive-grid.tablet-col-3 .product-card-wrapper {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }
}

/* Pastikan Desktop selalu konsisten 4 kolom untuk White-space yang lega */
@media (min-width: 992px) {
    .product-tabs-responsive-grid .product-card-wrapper {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
}