/*
Theme Name:   Storefront Child
Theme URI:    https://laidbackcafe.official.ec/
Description:  Storefront Child Theme for Laid Back Cafe - Aozora Yogurt Design
Author:       Admin
Template:     storefront
Version:      2.0.0
*/

/* ==========================================================================
   1. CSS 변수 및 디자인 토큰 정의
   ========================================================================== */
:root {
    --brand-blue: #2696c8;
    --brand-blue-hover: #1d7ba6;
    --accent-warm: #ff9f43;
    --accent-warm-hover: #ee8c2e;
    --charcoal: #1a1a1a;
    --charcoal-light: #2d3436;
    --bg-light: #fdfdfd;
    --white: #ffffff;
    --border-subtle: rgba(0, 0, 0, 0.07);
    --font-main: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Noto Serif JP', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
}

/* ==========================================================================
   2. 글로벌 베이스 스타일
   ========================================================================== */
html {
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-light) !important;
    color: var(--charcoal-light) !important;
    font-family: var(--font-main) !important;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    padding-top: 75px; /* 상단 고정 헤더 높이만큼 확보 */
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after {
    box-sizing: border-box !important;
}

/* 부모 테마 불필요한 기본 여백 제거 및 컨테이너 최적화 */
.site-header {
    padding: 0 !important;
    margin: 0 !important;
    border-bottom: none !important;
    width: 100% !important;
}

.site-header .col-full,
.site-content .col-full {
    max-width: 1280px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

.right-sidebar .content-area,
.left-sidebar .content-area,
.site-main {
    width: 100% !important;
    float: none !important;
    margin: 0 auto !important;
}

/* 유틸리티 */
.desktop-only {
    display: flex !important;
}
.mobile-only {
    display: none !important;
}

/* ==========================================================================
   3. 일본식 도장 배지(Hanko) & 타이포그래피 유틸리티
   ========================================================================== */
.hanko {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent-warm);
    color: var(--accent-warm);
    font-family: var(--font-serif);
    font-weight: 900;
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.1em;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.9);
}

.hanko-accent {
    border-color: var(--accent-warm);
    color: var(--accent-warm);
}

.hanko-brand {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.25em;
}

.text-brand {
    color: var(--brand-blue);
}

/* ==========================================================================
   4. 커스텀 글래스모피즘 헤더 (Custom Navbar)
   ========================================================================== */
.custom-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 75px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 999;
}

/* 좌측 로고 영역 */
.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo .custom-logo-link img {
    max-height: 46px !important;
    width: auto !important;
    max-width: 180px !important;
    object-fit: contain;
    display: block;
    margin: 0;
}

.nav-logo .custom-logo-text {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 900;
    color: var(--brand-blue);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 중앙 데스크톱 네비게이션 링크 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--charcoal);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    transition: color 0.25s ease;
    padding: 6px 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--brand-blue);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--brand-blue);
    transition: width 0.25s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 우측 마이페이지 / 카트 버튼 */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-action-item {
    text-decoration: none;
    color: var(--charcoal);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.25s ease;
}

.nav-action-item:hover {
    color: var(--brand-blue);
}

.nav-action-item i {
    font-size: 16px;
}

.nav-action-item .cart-badge {
    color: var(--accent-warm);
    font-weight: 900;
    font-size: 12px;
}

/* ==========================================================================
   5. 모바일 햄버거 버튼 및 드로어 메뉴 (Drawer Menu)
   ========================================================================== */
.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--charcoal);
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1001;
}

.mobile-menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: #ffffff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    box-sizing: border-box;
}

.mobile-menu-drawer.is-active {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.drawer-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 900;
    color: var(--brand-blue);
    letter-spacing: 0.1em;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
}

.drawer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drawer-links li a {
    text-decoration: none;
    color: var(--charcoal);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
    transition: color 0.2s;
}

.drawer-links li a:hover {
    color: var(--brand-blue);
}

.drawer-links li a i {
    width: 20px;
    text-align: center;
    color: #888;
}

.drawer-divider {
    height: 1px;
    background-color: #eee;
    margin: 8px 0;
}

.drawer-cart-link {
    position: relative;
}

.drawer-cart-count {
    margin-left: auto;
    background-color: var(--accent-warm);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    border-radius: 12px;
    padding: 2px 8px;
}

.drawer-auth-item {
    margin-top: 15px;
}

.auth-btn {
    display: flex !important;
    justify-content: center;
    border-radius: 4px;
    padding: 12px !important;
    font-weight: 700 !important;
    text-align: center;
}

.login-btn {
    background-color: var(--brand-blue);
    color: #fff !important;
}

.login-btn i {
    color: #fff !important;
}

.logout-btn {
    background-color: #f1f2f6;
    color: #555 !important;
}

/* ==========================================================================
   6. 히어로 섹션 (Aozora Hero Banner)
   ========================================================================== */
.aozora-hero {
    position: relative;
    height: calc(100vh - 75px);
    min-height: 580px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--bg-light);
}

.hero-bg-text {
    position: absolute;
    font-size: 19vw;
    font-weight: 900;
    color: #f0f4f7;
    line-height: 0.8;
    letter-spacing: -0.05em;
    z-index: 1;
    pointer-events: none;
    text-align: center;
    user-select: none;
}

.hero-content {
    position: absolute;
    z-index: 10;
    top: 24%;
    left: 8%;
}

.hero-title-big {
    font-family: var(--font-serif);
    font-size: clamp(38px, 5.5vw, 76px);
    font-weight: 900;
    line-height: 1.15;
    color: var(--charcoal);
    margin: 15px 0;
}

.hero-vertical-sub {
    font-size: 13px;
    font-weight: 700;
    color: #888;
    height: 150px;
    margin-top: 15px;
}

.hero-product-img {
    position: relative;
    z-index: 5;
    width: 40vw;
    max-width: 520px;
    transform: rotate(-5deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-product-img:hover {
    transform: rotate(0deg) scale(1.04);
}

.hero-product-img img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    filter: drop-shadow(15px 30px 45px rgba(0, 0, 0, 0.12));
    display: block;
}

.hero-stamp {
    position: absolute;
    right: 12%;
    bottom: 18%;
    z-index: 15;
}

.price-badge {
    background: var(--accent-warm);
    color: var(--white);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotate(12deg);
    box-shadow: 0 10px 25px rgba(255, 159, 67, 0.35);
    border: 2px dashed rgba(255, 255, 255, 0.6);
}

.price-badge .label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.price-badge .price {
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
}

.price-badge .unit {
    font-size: 12px;
    font-weight: 700;
}

.side-decoration {
    position: fixed;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    pointer-events: none;
    opacity: 0.25;
    font-size: 11px;
    font-weight: 900;
    color: var(--charcoal);
}

/* ==========================================================================
   7. 상품 목록 및 상품 카드 (WooCommerce Product Loop)
   ========================================================================== */
.aozora-section-header {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    padding: 50px 0 25px;
    border-bottom: 2px solid var(--charcoal);
    margin-bottom: 40px;
}

.aozora-section-header .section-title {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 900;
    color: var(--brand-blue);
    margin: 0;
    line-height: 1;
}

.site-main ul.products {
    margin: 0 -15px 40px !important;
    padding: 0 !important;
}

.site-main ul.products li.product {
    background: #ffffff !important;
    padding: 24px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    box-sizing: border-box !important;
    position: relative !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    text-align: left !important;
    margin-bottom: 30px !important;
}

.site-main ul.products li.product:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 36px rgba(38, 150, 200, 0.08) !important;
}

.product-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
}

.site-main ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    border-radius: 6px !important;
    margin-bottom: 16px !important;
    transition: transform 0.3s ease;
}

.site-main ul.products li.product:hover img {
    transform: scale(1.02);
}

.site-main ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-serif) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--charcoal) !important;
    margin-bottom: 10px !important;
    line-height: 1.4 !important;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.site-main ul.products li.product .price {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: var(--charcoal) !important;
    margin-bottom: 16px !important;
    display: block;
}

.site-main ul.products li.product .price del {
    font-size: 13px !important;
    color: #999 !important;
    font-weight: normal;
    margin-right: 6px;
}

.site-main ul.products li.product .button {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    background-color: var(--charcoal) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 12px 0 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    transition: background-color 0.25s ease !important;
    box-shadow: none !important;
}

.site-main ul.products li.product .button:hover {
    background-color: var(--brand-blue) !important;
}

/* ==========================================================================
   8. 우커머스 정렬 (Sorting) 스타일 지정
   ========================================================================== */
.storefront-sorting {
    text-align: right;
    margin-bottom: 25px;
    clear: both;
}

.woocommerce-ordering {
    display: inline-block;
    margin: 0 !important;
    position: relative;
    z-index: 50;
}

.woocommerce-ordering select.orderby {
    padding: 8px 30px 8px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 13px;
    color: var(--charcoal);
    cursor: pointer;
    font-family: var(--font-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    outline: none;
    height: 38px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20fill%3D%22%231a1a1a%22%20d%3D%22M2%204l4%204%204-4%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.woocommerce-ordering select.orderby:hover {
    border-color: var(--brand-blue);
}

/* ==========================================================================
   9. 라이트 베이지 커스텀 푸터 (Aozora Footer)
   ========================================================================== */
.aozora-custom-footer {
    background: #f8f7f5;
    color: var(--charcoal);
    padding: 70px 5% 30px;
    margin-top: 60px;
    clear: both;
}

.footer-container {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto 50px;
}

.footer-brand .footer-logo {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 900;
    color: var(--brand-blue);
    margin-bottom: 16px;
}

.footer-philosophy {
    font-size: 13px;
    color: #555555;
    line-height: 1.8;
    max-width: 380px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 900;
    color: var(--charcoal);
    margin-bottom: 18px;
    border-left: 3px solid var(--brand-blue);
    padding-left: 10px;
    letter-spacing: 0.05em;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #555555 !important;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: var(--brand-blue) !important;
}

.footer-address {
    font-size: 12px;
    color: #555555;
    line-height: 1.8;
}

.footer-address strong {
    color: var(--charcoal);
}

.footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 25px;
    text-align: center;
    color: #888888;
    font-size: 12px;
}

/* ==========================================================================
   9. 모바일 및 반응형 미디어 쿼리 (Mobile-First Optimization)
   ========================================================================== */
@media screen and (max-width: 768px) {
    html, body {
        font-size: 15px;
        padding-top: 65px;
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .site-header .col-full,
    .site-content .col-full {
        padding: 0 16px !important;
        max-width: 100% !important;
    }

    .custom-navbar {
        height: 65px;
        padding: 0 16px;
    }

    .nav-logo .custom-logo-link img {
        max-height: 42px !important;
        max-width: 150px !important;
    }

    /* 히어로 모바일 */
    .aozora-hero {
        height: auto;
        min-height: unset;
        padding: 35px 15px 30px;
        flex-direction: column;
        text-align: center;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
    }

    .hero-content {
        position: relative;
        top: unset;
        left: unset;
        margin-bottom: 20px;
        width: 100%;
    }

    .hero-title-big {
        font-size: 38px;
        line-height: 1.2;
        margin: 12px 0 8px;
    }

    .hero-vertical-sub {
        display: none;
    }

    .hero-product-img {
        width: 82vw;
        max-width: 320px;
        margin: 0 auto;
        transform: none;
    }

    .hero-stamp {
        position: relative;
        right: unset;
        bottom: unset;
        margin-top: -30px;
        margin-left: auto;
        margin-right: 10px;
        z-index: 15;
    }

    .price-badge {
        width: 105px;
        height: 105px;
    }

    .price-badge .price {
        font-size: 25px;
    }

    .price-badge .unit {
        font-size: 11px;
    }

    /* 섹션 타이틀 */
    .aozora-section-header {
        padding: 35px 0 15px;
        margin-bottom: 20px;
    }

    .aozora-section-header .section-title {
        font-size: 26px;
    }

    /* 정렬 드롭다운 모바일 */
    .storefront-sorting {
        margin-bottom: 20px;
    }

    .woocommerce-ordering select.orderby {
        font-size: 14px;
        height: 40px;
        padding: 8px 32px 8px 14px;
    }

    /* 상품 그리드 2열 반응형 (가독성 & 터치 최적화) */
    .site-main ul.products {
        margin: 0 -6px 30px !important;
    }

    .site-main ul.products li.product {
        width: 48% !important;
        float: left !important;
        margin-right: 4% !important;
        margin-bottom: 20px !important;
        padding: 16px 12px !important;
    }

    .site-main ul.products li.product:nth-child(2n) {
        margin-right: 0 !important;
    }

    .site-main ul.products li.product .woocommerce-loop-product__title {
        font-size: 15px !important;
        font-weight: 700 !important;
        height: auto !important;
        min-height: 40px;
        margin-bottom: 8px !important;
    }

    .site-main ul.products li.product .price {
        font-size: 17px !important;
        font-weight: 800 !important;
        margin-bottom: 12px !important;
    }

    .site-main ul.products li.product .button {
        padding: 12px 0 !important;
        font-size: 13px !important;
        font-weight: 800 !important;
        border-radius: 4px !important;
    }

    /* 푸터 모바일 */
    .aozora-custom-footer {
        padding: 50px 16px 25px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 35px;
        margin-bottom: 35px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .footer-brand .footer-logo {
        font-size: 24px;
    }

    .footer-philosophy {
        font-size: 14px;
    }

    .footer-col h4 {
        font-size: 14px;
    }

    .footer-col a,
    .footer-address {
        font-size: 13px;
    }
}

/* ==========================================================================
   11. 주소 자동 완성 하이라이트 스타일 (Postcode Autofill Feedback)
   ========================================================================== */
input.field-autofilled,
select.field-autofilled,
.select2-container .select2-selection.field-autofilled {
    background-color: #f0fdf4 !important;
    border-color: #86efac !important;
    box-shadow: 0 0 0 2px rgba(134, 239, 172, 0.25) !important;
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

input.field-autofilled:focus,
select.field-autofilled:focus,
.select2-container--focus .select2-selection.field-autofilled {
    background-color: #ffffff !important;
    border-color: var(--brand-blue) !important;
    box-shadow: 0 0 0 3px rgba(38, 150, 200, 0.2) !important;
}

/* ==========================================================================
   12. 일본식 주소 폼 2컬럼 레이아웃 정렬 (姓・名 2단 정돈)
   ========================================================================== */
.woocommerce-address-fields__field-wrapper,
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.woocommerce-address-fields__field-wrapper .form-row-first,
.woocommerce-address-fields__field-wrapper .form-row-last,
.woocommerce-billing-fields__field-wrapper .form-row-first,
.woocommerce-billing-fields__field-wrapper .form-row-last,
.woocommerce-shipping-fields__field-wrapper .form-row-first,
.woocommerce-shipping-fields__field-wrapper .form-row-last {
    width: 48.5% !important;
    float: none !important;
    margin-bottom: 20px !important;
}

.woocommerce-address-fields__field-wrapper .form-row-wide,
.woocommerce-billing-fields__field-wrapper .form-row-wide,
.woocommerce-shipping-fields__field-wrapper .form-row-wide {
    width: 100% !important;
    float: none !important;
    margin-bottom: 20px !important;
}

/* Blocks Checkout에서 국가 선택 필드 강제 숨김 */
.wc-block-components-address-form .wc-block-components-address-form__country {
    display: none !important;
}

@media screen and (max-width: 480px) {
    .woocommerce-address-fields__field-wrapper .form-row-first,
    .woocommerce-address-fields__field-wrapper .form-row-last,
    .woocommerce-billing-fields__field-wrapper .form-row-first,
    .woocommerce-billing-fields__field-wrapper .form-row-last,
    .woocommerce-shipping-fields__field-wrapper .form-row-first,
    .woocommerce-shipping-fields__field-wrapper .form-row-last {
        width: 48.5% !important; /* 모바일에서도 성/이름은 2단 유지하여 컴팩트하게 */
    }
}