/*
 Theme Name:   Tokowhatsapp Child
 Theme URI:    https://toko-wijayaleather.com
 Description:  Child theme for Tokowhatsapp (TasteSkill Premium Redesign)
 Author:       Admin
 Author URI:   https://toko-wijayaleather.com
 Template:     tokowhatsapp
 Version:      2.1.2
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  tokowhatsapp-child
*/

/* 1. TYPOGRAPHY (Plus Jakarta Sans) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..800&display=swap');

body, h1, h2, h3, h4, h5, h6, p, a, span, button, input, div {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

body {
    background-color: #fcfcfc !important; /* Soft Structuralism white/silver base */
    color: #111 !important;
    padding-bottom: 6rem !important; /* Breathing room at bottom */
}

/* Massive Typographic Headings */
.store .store-name {
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}
.store .store-name .verified-badge {
    margin: 0 !important;
}
.store .store-name h1 {
    font-size: clamp(2rem, 5vw, 3.5rem) !important; 
    font-weight: 800 !important;
    letter-spacing: -0.05em !important;
    line-height: 1.1 !important;
    color: #050505 !important;
    margin-bottom: 0.5rem !important;
    height: auto !important;
}

.store-description {
    font-size: 1.125rem !important;
    color: #666 !important;
    max-width: 45ch !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
}

/* 2. FLUID ISLAND NAV (Premium App Header) */
header.header, .site-header {
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    border-radius: 1.5rem !important;
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 8px 32px -8px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,1) !important;
    padding: 0.5rem 1rem !important;
    position: sticky !important;
    top: 1rem !important;
    z-index: 50 !important;
    transition: all 700ms cubic-bezier(0.32, 0.72, 0, 1) !important;
}

header.header:hover {
    box-shadow: 0 16px 40px -12px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,1) !important;
}

/* Mobile tweak for header */
@media (max-width: 768px) {
    header.header {
        border-radius: 2rem !important;
        width: 95% !important;
        top: 0.5rem !important;
        margin-top: 0.5rem !important;
    }
}

/* 3. PREMIUM APP GRID (2-Column, Override Masonry & Clearfix) */
.loop, .row.products, .productbox-wrap, .products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    padding: 1rem 0 !important;
    height: auto !important; /* Override Masonry fixed height */
    align-items: stretch !important; /* Match heights across row */
}

/* Fix CSS Grid treating legacy clearfix pseudo-elements as empty grid cells */
.loop:before, .loop:after, 
.row.products:before, .row.products:after, 
.productbox-wrap:before, .productbox-wrap:after, 
.products:before, .products:after {
    display: none !important;
}

.productbox-grid, .productbox-shop, .productbox-feed, .productbox, .loop > article {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    float: none !important;
    position: relative !important; /* Override Masonry absolute */
    left: auto !important;         /* Override Masonry inline left */
    top: auto !important;          /* Override Masonry inline top */
    height: 100% !important;       /* Stretch to fill grid cell */
}

/* Ensure inner anchor fills height */
.productbox > a {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
}

/* Ensure content fills height */
.productbox .content {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    height: 100% !important;
}

/* Mobile 2-col override for very small screens */
@media (max-width: 480px) {
    .loop, .row.products, .productbox-wrap, .products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important; /* slightly smaller gap on mobile */
    }
}

/* 4. DOUBLE-BEZEL CARDS (Machined Hardware Look) */
.postbox, .product-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    padding: 8px !important; /* Outer shell padding */
    border-radius: 2rem !important; /* 32px */
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.03), inset 0 1px 0 rgba(255,255,255,1) !important;
    transition: all 700ms cubic-bezier(0.32, 0.72, 0, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    position: relative !important;
}

.postbox:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,1) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.postbox .thumbnail, .product-image { /* Inner core */
    border-radius: calc(2rem - 8px) !important; /* 24px inner radius */
    overflow: hidden !important;
    position: relative !important;
    background: #f4f4f5 !important; /* placeholder grey */
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05) !important;
    margin-bottom: 16px !important;
}

/* Product Thumb (Image Wrapper) */
.productbox .thumb {
    position: relative;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    background: #f8f9fa;
    width: 100%; /* Ensure full width */
}

/* Ensure Uniform Product Image Size */
.productbox .thumb img, .product-gallery-swiper img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1; /* Force square aspect ratio */
    object-fit: cover; /* Prevent stretching, crop beautifully */
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Swiper Gallery Adjustments */
.product-gallery-swiper {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}
.swiper-pagination-bullet-active {
    background: #050505 !important;
}
.swiper-pagination {
    bottom: 8px !important;
}

.postbox .thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: all 1s cubic-bezier(0.32, 0.72, 0, 1) !important;
}

.postbox:hover .thumbnail img {
    transform: scale(1.08) !important;
}

/* 5. TYPOGRAPHY HIERARCHY IN CARDS */
.productbox .title {
    flex-grow: 1 !important; /* Push price to bottom */
}
.postbox .content .title h3, .productbox .content .title h3 {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: #111 !important;
    margin-bottom: 8px !important;
    padding: 0 8px !important;
}

.postbox .price {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #666 !important;
    padding: 0 8px !important;
    margin-bottom: 16px !important;
}

/* 6. BUTTON-IN-BUTTON CTA & MAGNETIC PHYSICS */
.basket-action, .add_to_cart_inline {
    padding: 0 8px 8px 8px !important;
    margin-top: auto !important;
}

.button, .btn, .add_to_cart_button, #admin-contact-wa {
    background: #050505 !important;
    color: #fff !important;
    border-radius: 9999px !important;
    padding: 10px 16px 10px 20px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    letter-spacing: -0.01em !important;
    transition: all 500ms cubic-bezier(0.32, 0.72, 0, 1) !important;
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    box-sizing: border-box !important;
}

.button:hover, .btn:hover, #admin-contact-wa:hover {
    transform: scale(0.97) !important;
    background: #1a1a1a !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
    color: #fff !important;
}

/* Nested trailing icon styling (targeting any i or svg inside button) */
.button i, .button svg, .btn i, .btn svg, #admin-contact-wa i {
    background: rgba(255,255,255,0.15) !important;
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 500ms cubic-bezier(0.32, 0.72, 0, 1) !important;
    margin: 0 0 0 12px !important;
    position: relative !important; /* Kill any absolute positioning from parent theme */
    right: auto !important;
    top: auto !important;
    left: auto !important;
    bottom: auto !important;
}

/* Specific fix for Hubungi Kami button (Header) */
#admin-contact-wa {
    width: max-content !important;
    justify-content: center !important;
    padding: 10px 20px 10px 16px !important; /* flip padding for left icon */
    margin-top: 20px !important; /* increased from 8px for better spacing */
}
#admin-contact-wa i {
    margin: 0 12px 0 0 !important; /* Icon is on the left, so margin right */
}

.button:hover i, .button:hover svg, #admin-contact-wa:hover i {
    transform: translate(3px, -2px) scale(1.1) !important;
    background: #fff !important;
    color: #000 !important;
}

/* 7. SCROLL REVEAL UTILITIES (Used by JS) */
.reveal-init {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(8px);
    transition: opacity 900ms cubic-bezier(0.32, 0.72, 0, 1), 
                transform 900ms cubic-bezier(0.32, 0.72, 0, 1),
                filter 900ms cubic-bezier(0.32, 0.72, 0, 1);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Mobile Button Fix - Placed at the very end to guarantee override */
@media (max-width: 480px) {
    #admin-contact-wa {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* 7. PREMIUM PRODUCT PAGE UI (Select & Quantity) */
.product .content .variations .variation {
    width: 100% !important;
    height: auto !important;
    margin-bottom: 16px;
    float: none !important;
}
.product .content .variations .variation label {
    font-size: 0.875rem !important;
    color: #444 !important;
    margin-bottom: 8px !important;
    font-weight: 700 !important;
}
.product .content .variations .variation select {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    background-color: #f9fafb !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #111 !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 18px !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}
.product .content .variations .variation select:focus {
    outline: none !important;
    border-color: #111 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 4px rgba(0,0,0,0.05) !important;
}

/* Premium Quantity Chooser */
.product .content .actions .action {
    float: none !important;
    width: 100% !important;
    margin-bottom: 12px !important;
}
.quantity-chooser {
    display: flex !important;
    align-items: center !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    background-color: #f9fafb !important;
    height: 54px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
.quantity-chooser::before,
.quantity-chooser::after {
    display: none !important;
    content: none !important;
}
.quantity-chooser div {
    flex: 0 0 54px !important;
    height: 100% !important;
    width: 54px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    font-size: 1.5rem !important;
    color: #111 !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}
.quantity-chooser div:hover {
    background: #f3f4f6 !important;
}
.quantity-chooser div:first-child {
    border-right: 1px solid #e5e7eb !important;
}
.quantity-chooser div:nth-child(3) {
    border-left: 1px solid #e5e7eb !important;
}
.quantity-chooser input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #111 !important;
    margin: 0 !important;
    text-align: center !important;
}

/* Premium Add to Cart Button */
.product .content .actions .action button {
    height: 54px !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px !important;
    background: #050505 !important;
    border: none !important;
    color: #ffffff !important;
    transition: transform 0.2s, background 0.2s !important;
    width: 100% !important;
    line-height: 54px !important;
}
.product .content .actions .action button:active {
    transform: scale(0.98) !important;
    background: #222 !important;
}

/* 8. MOBILE HEADER LAYOUT FIX (Align Title and Description) */
@media only screen and (max-width: 514px) {
    .store-box {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        margin-top: 24px !important;
        margin-bottom: 16px !important;
    }
    .store-box .store-box-left {
        position: relative !important;
        float: none !important;
        width: 100px !important;
        height: 100px !important;
        margin-bottom: 16px !important;
    }
    .store-box .store-box-left .logo {
        width: 100% !important;
        height: 100% !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
        border: 1px solid #f0f0f0 !important;
    }
    .store-box .store-box-right {
        width: 100% !important;
    }
    .store .store-name {
        padding-left: 0 !important;
        height: auto !important;
        justify-content: center !important;
        margin-bottom: 6px !important;
    }
    .store .store-name h1 {
        line-height: 1.2 !important;
        font-weight: 800 !important;
        font-size: 1.5rem !important;
    }
    .store-description {
        text-align: center !important;
        margin-top: 0 !important;
        margin-bottom: 20px !important;
        font-size: 1rem !important;
        color: #666 !important;
    }
    .store .store-contact {
        margin-top: 0 !important;
    }
}

/* Premium WA Contact Button */
.store .store-contact button {
    height: 48px !important;
    border-radius: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 24px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    border: none !important;
    background: #050505 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    transition: transform 0.2s !important;
}
.store .store-contact button:active {
    transform: scale(0.96) !important;
}
.store .store-contact button i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    background: #fff !important;
    color: #050505 !important;
    border-radius: 50% !important;
    margin-right: 10px !important;
    font-size: 1rem !important;
    line-height: 1 !important;
}

/* 9. PRODUCT GRID TYPOGRAPHY */
.productbox-shop .content .title h3,
.productbox-feed .content .title h3,
.productbox-grid .content .title h3,
.productbox-list .content .title h3 {
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    line-height: 1.4 !important;
    font-size: 0.875rem !important; /* 14px */
    margin-bottom: 4px !important;
}

/* 10. STICKY ADD TO CART ON MOBILE */
@media only screen and (max-width: 514px) {
    .single-instaorder-product .product .content .actions {
        position: fixed !important;
        bottom: 50px !important; /* Right above the flying footer */
        left: 0 !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        z-index: 996 !important;
        padding: 12px 16px !important;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.08) !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Hide clear pseudo-elements that break flexbox */
    .single-instaorder-product .product .content .actions::before,
    .single-instaorder-product .product .content .actions::after,
    .quantity-chooser::before,
    .quantity-chooser::after {
        display: none !important;
        content: none !important;
    }
    
    .single-instaorder-product .product .content .actions .action {
        margin-bottom: 0 !important;
        min-width: 0 !important; /* Prevent flex blowout */
    }
    
    .single-instaorder-product .product .content .actions .action:first-of-type {
        flex: 0 0 110px !important; /* Width for quantity chooser */
    }
    
    .single-instaorder-product .product .content .actions .action:last-of-type {
        flex: 1 1 auto !important; /* Button takes the rest */
        width: 100% !important;
    }
    
    /* Make quantity chooser slightly more compact in sticky bar */
    .single-instaorder-product .quantity-chooser {
        height: 48px !important;
    }
    .single-instaorder-product .quantity-chooser div {
        flex: 0 0 34px !important;
        width: 34px !important;
        font-size: 1.25rem !important;
    }
    
    .single-instaorder-product .product .content .actions .action button {
        height: 48px !important;
        line-height: 48px !important;
        font-size: 0.95rem !important;
    }

    /* Prevent content from hiding behind the sticky bar */
    body.single-instaorder-product {
        padding-bottom: 180px !important;
    }
}

/* 11. PREMIUM CHECKOUT UI */
.checkout {
    background: #f4f6f8 !important;
}
.checkout .checkout-inner .heading {
    border-bottom: 1px solid #f0f0f0 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #111 !important;
    padding: 0 20px !important;
}
.checkout-customer-form, .checkout-item, .checkout-coupon, .checkout-detail {
    background: #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important;
    border-radius: 16px !important;
    margin: 16px !important;
    padding: 20px !important;
    border: 1px solid #f0f0f0 !important;
}
.checkout-customer-form .inner-box, .checkout-coupon .inner-box {
    padding: 0 !important;
    border: none !important;
}
.checkout-customer-form .customer-field {
    margin-bottom: 16px !important;
}
.checkout-customer-form .customer-field label {
    font-size: 0.875rem !important;
    color: #444 !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    display: inline-block !important;
}
.checkout-customer-form .customer-field input,
.checkout-customer-form .customer-field textarea,
.coupon-field input {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    background-color: #f9fafb !important;
    font-size: 1rem !important;
    color: #111 !important;
    box-sizing: border-box !important;
    transition: all 0.2s !important;
}
.checkout-customer-form .customer-field input:focus,
.checkout-customer-form .customer-field textarea:focus,
.coupon-field input:focus {
    outline: none !important;
    border-color: #111 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 4px rgba(0,0,0,0.05) !important;
}

/* Coupon Button */
.checkout .checkout-inner .checkout-coupon .heading {
    padding: 0 0 16px 0 !important;
    border: none !important;
}
.coupon-field {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
}
.coupon-field input {
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}
.coupon-field button {
    position: static !important;
    width: auto !important;
    min-width: 100px !important;
    flex-shrink: 0 !important;
    height: 50px !important;
    line-height: 50px !important;
    padding: 0 20px !important;
    background: #050505 !important;
    border: none !important;
    border-radius: 12px !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    transition: transform 0.2s, background 0.2s !important;
}
.coupon-field button:active {
    transform: scale(0.96) !important;
    background: #222 !important;
}

/* Submit Button */
.checkout-submit {
    margin: 16px !important;
}
.checkout-submit button {
    height: 54px !important;
    border-radius: 16px !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px !important;
    background: #050505 !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
    width: 100% !important;
    transition: transform 0.2s !important;
}
.checkout-submit button:active {
    transform: scale(0.98) !important;
}

/* Checkout Item styling */
.checkout-item {
    display: flex !important;
    align-items: flex-start !important;
    padding: 16px !important;
}
.checkout-item .item-image {
    width: 80px !important;
    height: 80px !important;
    border-radius: 12px !important;
    background-color: #f5f5f5 !important;
    border: 1px solid #f0f0f0 !important;
}
.checkout-item .item-detail {
    width: calc(100% - 92px) !important;
    padding: 0 0 0 12px !important;
    float: none !important;
}
.checkout-item .item-detail .item-detail-top {
    font-size: 1rem !important;
    color: #111 !important;
    padding: 0 24px 0 0 !important;
    height: auto !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
}
.checkout-item-delete {
    top: 16px !important;
    right: 16px !important;
    opacity: 0.5 !important;
}
.checkout-item-delete:hover {
    opacity: 1 !important;
}
.checkout-item .item-detail .item-detail-bottom {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 12px !important;
    padding: 0 !important;
}
.checkout-item-subtotal-price {
    color: #050505 !important;
    font-size: 1rem !important;
    float: none !important;
    height: auto !important;
    line-height: 1 !important;
}
