/*
Theme Name: Ilardi
Theme URI: http://ilardi.com
Author: Ilardi Team
Author URI: https://ilardi.com
Description: A custom WooCommerce theme for wine catalog
Version: 1.2.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ilardi
*/

/* Font Variables */
:root {
    --font-primary: 'Rokkitt', serif;
    --font-secondary: 'Rokkitt', serif;
    --font-decorative: 'Rokkitt', serif;
    --font-title: 'Rokkitt', serif;
    --font-handwriting: 'Rokkitt', serif;
    --font-chinese: 'Noto Sans SC', sans-serif;
    --font-emoji: 'Noto Color Emoji', sans-serif;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    background-color: #f5f5f5;
}

.site-container {
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
}

/* Header Styles */
.site-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #000;
}

.logo-union-des-grands-vins {
    width: auto;
    height: 60px;
    object-fit: contain;
}

.site-title {
    font-family: var(--font-title);
    font-size: 32px;
    text-decoration: none;
    color: #000;
}

/* Catalog Header */
.catalog-header {
    padding: 20px;
    border-bottom: 1px solid #000;
}

.catalog-title {
    font-family: var(--font-secondary);
    font-size: 24px;
    margin-bottom: 10px;
}

.catalog-description {
    font-family: var(--font-handwriting);
    font-size: 16px;
    line-height: 1.5;
}

/* Filter Bar */
.filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #000;
}

.filter-item {
    padding: 15px;
    text-align: center;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.filter-item:first-child {
    border-right: 1px solid #000;
}

.filter-item::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 8px;
}

.filter-item.filter::before {
    content: "\f0b0";
}

.filter-item.search::before {
    content: "\f002";
}

/* Sliding Panels */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
}

.panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-panel,
.search-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 400px;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-panel.active,
.search-panel.active {
    transform: translateX(0);
}

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

.panel-title {
    font-size: 18px;
    font-weight: bold;
}

.panel-close {
    border: none;
    background: none;
    padding: 8px;
    cursor: pointer;
    font-size: 20px;
}

.panel-content {
    padding: 20px;
}

/* Archive Product Grid */
.archive-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-bottom: 1px solid #000;
}

@media (min-width: 769px) {
    .archive-products {
        grid-template-columns: repeat(4, 1fr);
    }
}

.archive-products .product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    border-top: 1px solid #000;
}

.archive-products .product-link:nth-child(odd) {
    border-right: 1px solid #000;
}

@media (min-width: 769px) {
    .archive-products .product-link:nth-child(odd) {
        border-right: none;
    }
    
    .archive-products .product-link:not(:nth-child(4n)) {
        border-right: 1px solid #000;
    }
}

.archive-products .product {
    position: relative;
    background: #fff;
    aspect-ratio: 4/5;
    display: flex;
    flex-direction: column;
}

.archive-products .product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.archive-products .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* BIO Badge */
.bio-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: #2d5016;
    color: #fff;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    z-index: 3;
    letter-spacing: 1px;
    line-height: 1;
}

/* Format Badge */
.format-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    z-index: 3;
    line-height: 1;
}

/* Adjust format badge when BIO badge is also present */
.product-image .bio-badge + .format-badge,
.product-image .format-badge:has(+ .bio-badge) {
    max-width: calc(100% - 80px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archive-products .product-info {
    position: relative;
    z-index: 2;
    padding: 8px 8px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.archive-products .product-title {
    font-size: 18px;
    margin: 0;
    color: #000;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    white-space: normal;
    max-height: 24px;
}

.archive-products .wine-date {
    font-size: 18px;
    color: #000000;
}

.archive-products .product-price {
    font-size: 14px;
    color: #000;
    margin-top: 4px;
}

/* Single Product */
.single-product .product-image {
    width: 100%;
    aspect-ratio: 8/5;
    position: relative;
    border-bottom: 1px solid #000;
}

.single-product .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.single-product .product-image .bio-badge {
    position: absolute;
    bottom: 16px;
    right: 16px;
}

.single-product .product-image .format-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
}

.single-product .product-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
}

.single-product .product-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.single-product .product-title {
    font-size: 20px;
    margin: 0;
    color: #000;
    font-weight: normal;
}

.single-product .wine-date {
    font-size: 18px;
    color: #000000;
}

.single-product .product-price {
    font-size: 14px;
    color: #000;
    margin-top: 4px;
}

.single-product .product-format-info {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
}

.single-product .product-format-info strong {
    color: #000;
    font-weight: 600;
}

.single-product .quantity-selector {
    width: 120px;
    color: #000!important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.single-product .quantity-selector select {
    width: 100%;
    padding: 8px;
    border: 1px solid #000;
    background: #fff;
    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%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 8px;
    padding-right: 24px;
}

.single-product .product-buttons {
    padding: 16px;
    display: grid;
    gap: 10px;
    border-bottom: 1px solid #000;
}

.single-product .btn {
    width: 100%;
    padding: 12px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    margin-bottom: 8px;
}

.single-product .btn-cart {
    background: #fff;
    border: 1px solid #000;
    color: #000!important;
}

.single-product .btn-purchase {
    background: #000;
    color: #fff;
}

.single-product .similar-wine-text {
    padding: 16px;
    border-bottom: 1px solid #000;
}

.single-product .similar-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

.single-product .similar-description {
    font-size: 14px;
    margin-bottom: 16px;
}

.single-product .similar-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: #000;
}

.single-product .similar-products .product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.single-product .similar-products .product {
    position: relative;
    background: #fff;
    aspect-ratio: 4/5;
    display: flex;
    flex-direction: column;
}

.single-product .similar-products .product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.single-product .similar-products .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-product .similar-products .product-image .bio-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
}

.single-product .similar-products .product-image .format-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
}

.single-product .similar-products .product-info {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 2px;
    z-index: 2;
    padding: 8px 8px 0 16px;
    border-bottom: none;
}

.single-product .similar-products .wine-date {
    font-size: 18px;
    color: #000000;
}

.single-product .similar-products .product-title {
    font-size: 18px;
    margin: 0;
    color: #000;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    white-space: normal;
    max-height: 24px;
}

.single-product .similar-products .product-price {
    font-size: 14px;
    color: #000;
    margin-top: 4px;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: #fff;
    transition: height 0.3s ease;
    z-index: 999;
    overflow: hidden;
    text-align: center;
    margin: 0 auto;
}

.cart-notification.active {
    height: 80px;
    border-top: 1px solid #000;
}

.cart-notification-content {
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.cart-count {
    font-family: var(--font-handwriting);
}

.cart-link {
    text-decoration: none;
    color: #000;
}

/* Success Notification */
.success-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.success-notification.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Styling*/

.wc-block-cart .wc-block-components-sidebar{
    padding: 8px
}

.wc-block-cart .wc-block-components-sidebar {
    border-left: 1px solid #000;
}
body:not(.woocommerce-block-theme-has-button-styles) .wc-block-components-button:not(.is-link)
{
    text-decoration: none;
    color: #000;
    border: 1px solid #000;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background: #fff;
}

form.wc-block-components-form.wc-block-checkout__form{
    padding: 8px;
}

.wc-block-components-form .wc-block-components-text-input input[type=email], .wc-block-components-form .wc-block-components-text-input input[type=number], .wc-block-components-form .wc-block-components-text-input input[type=password], .wc-block-components-form .wc-block-components-text-input input[type=tel], .wc-block-components-form .wc-block-components-text-input input[type=text], .wc-block-components-form .wc-block-components-text-input input[type=url], .wc-block-components-text-input input[type=email], .wc-block-components-text-input input[type=number], .wc-block-components-text-input input[type=password], .wc-block-components-text-input input[type=tel], .wc-block-components-text-input input[type=text], .wc-block-components-text-input input[type=url] {
    border-radius: 0!important;
}

.wc-blocks-components-select .wc-blocks-components-select__select{
    border-radius: 0!important;
}

.wp-block-woocommerce-checkout-order-summary-block{
    border: 1px solid #000!important;
    border-radius: 0!important;
}

/* Product Titles and Text */
.product-title {
    font-family: var(--font-secondary);
    font-weight: 500;
}

.product-price {
    font-family: var(--font-primary);
}

/* Buttons */
.btn {
    font-family: var(--font-primary);
    font-weight: 600;
}

/* Cart Notification */
.cart-notification {
    font-family: var(--font-primary);
}

.cart-count {
    font-family: var(--font-handwriting);
}

/* Success Notification */
.success-notification {
    font-family: var(--font-primary);
    font-weight: 500;
}

/* Similar Wines Section */
.similar-title {
    font-family: var(--font-secondary);
}

.similar-description {
    font-family: var(--font-handwriting);
}

/* Footer Styles */
.site-footer {
    padding: 20px 16px;
    font-family: var(--font-primary);
    font-size: 14px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.footer-links a {
    color: #000;
    text-decoration: none;
}

.footer-copyright {
    margin-top: 8px;
    color: #666;
}

/* Pagination */
.woocommerce-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #000;
}

.woocommerce-pagination .page-numbers {
    list-style: none;
    display: contents;
}

.woocommerce-pagination .page-numbers li {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    font-family: var(--font-primary);
    cursor: pointer;
    background: #fff;
}

.woocommerce-pagination .page-numbers li:first-child {
    border-right: 1px solid #000;
}

.woocommerce-pagination .page-numbers span.current,
.woocommerce-pagination .page-numbers a {
    text-decoration: none;
    color: #000;
    font-size: 16px;
}

.woocommerce-pagination .prev::before {
    content: "← Previous Page";
}

.woocommerce-pagination .next::before {
    content: "Next Page →";
}

.woocommerce-pagination .prev,
.woocommerce-pagination .next {
    font-size: 0;
}

/* Hide other page numbers */
.woocommerce-pagination .page-numbers li:not(:first-child):not(:last-child) {
    display: none;
}

@media (max-width: 768px) {
    .wc-block-components-sidebar-layout.wc-block-cart{
        padding: 16px;
    }
    .wc-block-components-sidebar-layout.wc-block-cart{
        border-left:none;
    }

    .wc-block-components-sidebar-layout{
        padding: 16px;
    }

}

/* Order Received (Thank You) - Minimalistic, B/W, no radius, 8px spacing */
.woocommerce-order-received .woocommerce,
.woocommerce-order-received .wc-block-order-confirmation {
    background: #fff;
}

/* Header / Status */
.woocommerce-order-received .woocommerce-thankyou-order-received,
.woocommerce-order-received .woocommerce-order .woocommerce-notice,
.woocommerce-order-received .wc-block-order-confirmation-status {
    padding: 24px;
    border-bottom: 1px solid #000;
    text-align: center;
}

/* Overview (order number, date, total, payment) */
.woocommerce-order-received .woocommerce-order-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #000;
}
.woocommerce-order-received .woocommerce-order-overview li {
    padding: 16px;
    border-top: 1px solid #000;
}
.woocommerce-order-received .woocommerce-order-overview li:nth-child(odd) {
    border-right: 1px solid #000;
}

/* Order details table (classic checkout) */
.woocommerce-order-received .woocommerce-order-details,
.woocommerce-order-received .woocommerce-customer-details {
    padding: 16px;
}
.woocommerce-order-received .woocommerce-order-details__title,
.woocommerce-order-received .woocommerce-column__title {
    font-size: 18px;
    margin: 0 0 8px 0;
}
.woocommerce-order-received table.shop_table {
    width: 100%;
    border: 1px solid #000;
    border-radius: 0;
    border-collapse: collapse;
    background: #fff;
}
.woocommerce-order-received table.shop_table th,
.woocommerce-order-received table.shop_table td {
    padding: 16px;
    border-right: 1px solid #000;
}
.woocommerce-order-received table.shop_table th {
    text-align: left;
    border-bottom: 1px solid #000;
}
.woocommerce-order-received table.shop_table tr + tr td {
    border-top: 1px solid #000;
}
.woocommerce-order-received table.shop_table th:last-child,
.woocommerce-order-received table.shop_table td:last-child {
    border-right: 0;
}

/* Addresses (classic) */
.woocommerce-order-received .woocommerce-customer-details .addresses {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.woocommerce-order-received .woocommerce-customer-details address {
    border: 1px solid #000;
    padding: 16px;
    font-style: normal;
    background: #fff;
}

/* Notices */
.woocommerce-order-received .woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-order-received .woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-order-received .woocommerce-notices-wrapper .woocommerce-error {
    border: 1px solid #000;
    background: #fff;
    color: #000;
    border-radius: 0;
    padding: 16px;
    margin: 16px 0;
}
.woocommerce-order-received .woocommerce-notices-wrapper .woocommerce-error li {
    list-style: none;
}

/* Blocks: Order Confirmation */
.woocommerce-order-received .wc-block-order-confirmation__section-title,
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-title,
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-order-status,
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-totals-block h2,
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-addresses h2 {
    font-size: 18px;
    margin: 0 0 8px 0;
}
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-order-status,
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-totals-block,
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-addresses {
    padding: 16px;
}
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-totals-block table,
.woocommerce-order-received .wc-block-order-confirmation-totals table {
    width: 100%;
    border: 1px solid #000;
    border-collapse: collapse;
    background: #fff;
}
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-totals-block th,
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-totals-block td,
.woocommerce-order-received .wc-block-order-confirmation-totals th,
.woocommerce-order-received .wc-block-order-confirmation-totals td {
    padding: 16px;
    border-right: 1px solid #000;
}
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-totals-block th,
.woocommerce-order-received .wc-block-order-confirmation-totals th {
    text-align: left;
    border-bottom: 1px solid #000;
}
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-totals-block tr + tr td,
.woocommerce-order-received .wc-block-order-confirmation-totals tr + tr td {
    border-top: 1px solid #000;
}
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-totals-block th:last-child,
.woocommerce-order-received .wp-block-woocommerce-order-confirmation-totals-block td:last-child,
.woocommerce-order-received .wc-block-order-confirmation-totals th:last-child,
.woocommerce-order-received .wc-block-order-confirmation-totals td:last-child {
    border-right: 0;
}

/* Blocks: Addresses */
.woocommerce-order-received .wc-block-order-confirmation-address {
    border: 1px solid #000;
    padding: 16px;
    background: #fff;
    margin-bottom: 16px;
}

/* Generic adjustments */
.woocommerce-order-received a {
    color: #000;
    text-decoration: none;
}
.woocommerce-order-received .button,
.woocommerce-order-received .wp-element-button,
.woocommerce-order-received .wc-block-components-button {
    border-radius: 0;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label, .wc-block-components-totals-footer-item .wc-block-components-totals-item__value{
    font-size: 16px!important;
}

.product-format {
    font-family: var(--font-primary);
    font-size: 11px;
    color: #666;
}