/*
Theme Name: ATOZ Furniture
Theme URI: https://atozfurniture.co.id
Description: Product catalog theme for PT Rantai Mas Mebelindo. Features 10k+ product catalog with AJAX search, portfolio showcase, and WhatsApp integration.
Version: 1.0.0
Author: DWAN
Author URI: https://dwan.id
Text Domain: atozfurniture
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   CSS Reset & Base Styles
   Note: Main styling handled by Tailwind CDN. This file contains overrides.
   ========================================================================== */

/* Ensure smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Base typography (matches static HTML) */
body {
    font-family: 'Open Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
}

/* ==========================================================================
   WordPress Core Overrides
   ========================================================================== */

/* Remove Gutenberg default max-width constraints */
.entry-content>* {
    max-width: none;
}

/* Fix WordPress image alignment */
.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
    float: left;
    margin-right: 1.5rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
}

/* ==========================================================================
   Custom Component Styles
   ========================================================================== */

/* Search dropdown */
.search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.search-dropdown.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f9fafb;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.search-result-info h4 {
    font-weight: 600;
    color: #264155;
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
}

.search-result-info p {
    color: #636e72;
    margin: 0;
    font-size: 0.8rem;
}

/* WhatsApp button */
.btn-whatsapp {
    background-color: #25D366;
    color: white;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    color: white;
    transform: translateY(-2px);
}

/* Hide scrollbar but keep functionality */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==========================================================================
   Admin Styles (for meta boxes)
   ========================================================================== */

.atoz-meta-box .form-table th {
    width: 150px;
    padding: 15px 10px 15px 0;
}

.atoz-meta-box .form-table td {
    padding: 10px;
}

.atoz-meta-box input[type="text"],
.atoz-meta-box input[type="number"],
.atoz-meta-box select,
.atoz-meta-box textarea {
    width: 100%;
    max-width: 400px;
}

.atoz-gallery-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.atoz-gallery-images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: move;
}

.atoz-gallery-images .remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

/* ==========================================================================
   Gutenberg Block Overrides (for Block Patterns)
   ========================================================================== */

/* Remove Gutenberg default constraints */
.wp-block-group.alignfull {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.entry-content .wp-block-group {
    margin-bottom: 0;
}

.entry-content .wp-block-columns {
    margin-bottom: 0;
}

/* Fix columns gap */
.wp-block-columns {
    gap: 2rem;
}

.wp-block-columns.is-layout-flex {
    gap: 3rem;
}

/* ==========================================================================
   Theme Color Utilities (Gutenberg-safe)
   ========================================================================== */

/* Background Colors */
.has-atoz-slate-background-color,
.section-slate {
    background-color: #264155 !important;
}

.has-atoz-gold-background-color {
    background-color: #F4C430 !important;
}

.has-atoz-cyan-background-color {
    background-color: #0077B6 !important;
}

.has-atoz-gray-light-background-color,
.section-gray-light {
    background-color: #F8F9FA !important;
}

/* Hero gradient background */
.section-gradient-hero {
    background: linear-gradient(105deg, #F0F4F8 50%, #fff 50%);
}

/* Dark footer background */
.section-footer {
    background-color: #1a2e3d;
}

/* Text Colors */
.has-atoz-slate-color,
.text-atoz-slate {
    color: #264155 !important;
}

.has-atoz-gold-color,
.text-atoz-gold {
    color: #F4C430 !important;
}

.has-atoz-cyan-color,
.text-atoz-cyan {
    color: #0077B6 !important;
}

.has-atoz-text-muted-color,
.text-atoz-muted {
    color: #636E72 !important;
}

/* ==========================================================================
   Button Styles (for Block Patterns)
   ========================================================================== */

/* Custom Button Reset for Gutenberg Wrapper 
   Prevents "double box" effect when class is on the wrapper */
.wp-block-button.btn-primary,
.wp-block-button.btn-gold,
.wp-block-button.btn-outline {
    background-color: transparent !important;
    padding: 0 !important;
    border: none !important;
}

/* Primary Button (Slate) */
.wp-block-button.btn-primary .wp-block-button__link,
.btn-primary:not(.wp-block-button) {
    background-color: #264155 !important;
    color: #fff !important;
    padding: 0.75rem 2rem;
    border-radius: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    border: 2px solid transparent !important;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none !important;
}

.wp-block-button.btn-primary .wp-block-button__link:hover,
.btn-primary:not(.wp-block-button):hover {
    background-color: #F4C430 !important;
    color: #264155 !important;
}

/* Gold Primary Button */
.wp-block-button.btn-gold .wp-block-button__link,
.btn-gold:not(.wp-block-button) {
    background-color: #F4C430 !important;
    color: #264155 !important;
    padding: 1rem 2.5rem;
    border-radius: 0.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none !important;
}

.wp-block-button.btn-gold .wp-block-button__link:hover,
.btn-gold:not(.wp-block-button):hover {
    background-color: #264155 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Outline Button */
.wp-block-button.btn-outline .wp-block-button__link,
.btn-outline:not(.wp-block-button) {
    background-color: transparent !important;
    color: #264155 !important;
    padding: 0.75rem 2rem;
    border-radius: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    border: 2px solid #264155 !important;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none !important;
}

.wp-block-button.btn-outline .wp-block-button__link:hover,
.btn-outline:not(.wp-block-button):hover {
    background-color: #264155 !important;
    color: #fff !important;
}

/* White Outline Button (for dark backgrounds) */
.wp-block-button.btn-outline-white .wp-block-button__link {
    background-color: transparent !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

.wp-block-button.btn-outline-white .wp-block-button__link:hover {
    background-color: #fff !important;
    color: #264155 !important;
}

/* ==========================================================================
   Component Styles (for Block Patterns)
   ========================================================================== */

/* ISO Badge (now Paragraph block) */
.iso-badge {
    display: inline-block;
    background-color: rgba(0, 119, 182, 0.1);
    color: #0077B6;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 1rem !important;
    /* Ensure override of Gutenberg margins */
    text-transform: uppercase;
    letter-spacing: 0.025em;
    line-height: 1.5;
}

/* Section Label (now Paragraph block) */
.section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem !important;
    /* Ensure override of Gutenberg margins */
}

.section-label-cyan {
    color: #0077B6;
}

.section-label-gold {
    color: #F4C430;
}

/* Manifesto List (now Group & Paragraph blocks) */
.manifesto-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.manifesto-list li,
.manifesto-list .manifesto-item {
    display: flex;
    margin-bottom: 2rem !important;
}

.manifesto-list .number {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #F4C430;
    margin-right: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    margin-bottom: 0 !important;
}

.manifesto-list .content strong,
.manifesto-list .content p:first-child strong {
    display: block;
    color: #264155;
    font-size: 1.125rem;
    margin-bottom: 0.25rem !important;
}

.manifesto-list .content p {
    color: #636E72;
    margin: 0 !important;
}

/* Overlapping Images Container */
.wp-block-group.overlapping-images,
.overlapping-images {
    position: relative !important;
    padding: 0 !important;
    /* Remove internal padding to simplify anchors */
    display: block !important;
    min-height: 100px;
    overflow: visible !important;
}

/* The first image (Main Image) */
.overlapping-images .main-image,
.overlapping-images figure.main-image {
    position: relative !important;
    z-index: 10 !important;
    margin: 0 !important;
    display: block !important;
    float: none !important;
    /* Prevent collapse */
    width: 100% !important;
}

.overlapping-images .main-image img {
    border-radius: 0.25rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* The second image (Overlay Image) */
.overlapping-images .overlay-image,
.overlapping-images figure.overlay-image,
.overlapping-images .wp-block-image.overlay-image {
    position: absolute !important;
    /* Use top/left percentages for better stability in Gutenberg groups */
    top: 40% !important;
    left: -2rem !important;
    width: 60% !important;
    z-index: 20 !important;
    margin: 0 !important;
    float: none !important;
}

.overlapping-images .overlay-image img {
    border: 8px solid #fff !important;
    border-radius: 0.25rem !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Responsive adjustment for overlay */
@media (max-width: 768px) {
    .overlapping-images .overlay-image {
        left: -1rem !important;
        top: 50% !important;
    }
}

/* Search Console (Slate Background) */
.search-console {
    background-color: #264155;
    padding: 2rem 2.5rem;
    border-radius: 0.5rem;
    margin-bottom: 4rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.search-console input[type="text"] {
    flex: 1;
    padding: 1rem;
    border-radius: 0.25rem;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-console input[type="text"]:focus {
    box-shadow: 0 0 0 2px #F4C430;
}

.search-console .popular-tags {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.search-console .popular-tags a {
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 2px;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
}

.search-console .popular-tags a:hover {
    color: #F4C430;
    border-color: #F4C430;
}

/* Product Card (for grids) */
.product-card {
    background: #fff;
    cursor: pointer;
}

.product-card .image-wrapper {
    height: 350px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    border-radius: 0.25rem 0.25rem 0 0;
}

.product-card .hover-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(38, 65, 85, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .hover-overlay {
    opacity: 1;
}

.product-card .category {
    font-size: 0.75rem;
    color: #0077B6;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.product-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #264155;
    margin: 0.5rem 0;
}

.product-card .price {
    color: #636E72;
    font-weight: 500;
}

/* Portfolio Card (grayscale hover) */
.portfolio-card {
    cursor: pointer;
}

.portfolio-card .image-wrapper {
    height: 400px;
    background-size: cover;
    background-position: center;
    margin-bottom: 1.5rem;
    filter: grayscale(100%);
    transition: filter 0.5s ease;
    border-radius: 0.25rem;
}

.portfolio-card:hover .image-wrapper {
    filter: grayscale(0%);
}

.portfolio-card .year {
    display: block;
    color: #F4C430;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.portfolio-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
}

.portfolio-card .type {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* News Card (border-top style) */
.news-card {
    border-top: 1px solid #d1d5db;
    padding-top: 1.5rem;
}

.news-card .date {
    color: #636E72;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.news-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #264155;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.news-card p {
    color: #636E72;
    margin-bottom: 1.5rem;
}

.news-card .read-more {
    color: #0077B6;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-card .read-more:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Section Spacing (for Block Patterns)
   ========================================================================== */

.section-py-lg {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.section-py-md {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.section-py-hero {
    padding-top: 3rem;
    padding-bottom: 5rem;
}

@media (min-width: 768px) {
    .section-py-hero {
        padding-top: 5rem;
    }
}

/* Container for patterns */
.atoz-container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .atoz-container {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media (min-width: 1024px) {
    .atoz-container {
        padding-left: 6rem;
        padding-right: 6rem;
    }
}