/*
Theme Name: RP Decor
Theme URI: https://rpdesign.lt/rp-decor
Author: OpenClaw
Author URI: https://rpdesign.lt
Description: A premium, minimalist WordPress WooCommerce theme tailored to elegant artisanal brands.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: rp-decor
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: e-commerce, custom-background, custom-header, block-styles, editor-style
*/

:root {
  --dl-bg: #f7f2ec;
  --dl-bg-soft: #efe5db;
  --dl-surface: #fffaf5;
  --dl-text: #241815;
  --dl-muted: #6f5b54;
  --dl-line: rgba(36, 24, 21, 0.1);
  --dl-accent: #7d8f73;
  --dl-accent-dark: #55624d;
  --dl-rose: #ae7c74;
  --dl-radius-lg: 32px;
  --dl-radius-md: 22px;
  --dl-shadow: 0 24px 80px rgba(77, 45, 32, 0.12);
  --dl-container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--dl-text);
  background: var(--dl-bg);
  font-family: var(--dl-font-body, 'Inter', system-ui, -apple-system, sans-serif);
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6, .site-title, .hero-title, .section-title {
  font-family: var(--dl-font-heading, 'Inter', system-ui, -apple-system, sans-serif);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: 0.3s; }
a:hover { color: var(--dl-accent); }

.container {
  width: min(calc(100% - 3rem), var(--dl-container));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(247, 242, 236, 0.82);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--dl-line);
}

.header-inner {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img { height: 40px; width: auto; }

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
}

.main-navigation a {
  font-weight: 500;
  color: var(--dl-muted);
}

.main-navigation li.current-menu-item a {
  color: var(--dl-text);
}

/* Hero Section */
.hero-section {
  padding: 8rem 0;
  text-align: center;
}

.hero-section h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin: 0 0 1.5rem;
  line-height: 1.1;
  font-weight: 700;
}

.hero-section p {
  font-size: 1.25rem;
  color: var(--dl-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  border-radius: 999px;
  background: var(--dl-text);
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: 0.3s;
}

.btn:hover {
  background: var(--dl-accent-dark);
  color: #fff;
  transform: translateY(-2px);
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

/* WooCommerce Overrides */
.woocommerce ul.products li.product {
  background: var(--dl-surface);
  border-radius: var(--dl-radius-md);
  padding: 1.5rem;
  border: 1px solid var(--dl-line);
  transition: 0.3s;
}

.woocommerce ul.products li.product:hover {
  box-shadow: var(--dl-shadow);
  transform: translateY(-5px);
}

/* --------------------------------------------------------------
 * WordPress Core Recommended Classes
 * -------------------------------------------------------------- */
.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: #fff; border: 1px solid #f0f0f0; max-width: 96%; 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: 11px; line-height: 17px; margin: 0; padding: 0 4px 5px; }
.gallery-caption { font-size: 12px; color: var(--dl-muted); margin-top: 5px; }
.bypostauthor { font-weight: normal; }
.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;
	width: 1px;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	background-color: #f1f1f1;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: #21759b;
	display: block;
	font-size: 14px;
	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;
}

/* Side Cart Drawer */
.dl-side-cart {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 2000;
    visibility: hidden;
    pointer-events: none;
    transition: var(--dl-cart-out, 400ms) visibility;
}

.dl-side-cart.is-active {
    visibility: visible;
    pointer-events: auto;
    transition: var(--dl-cart-in, 400ms) visibility;
}

.side-cart-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(var(--dl-cart-blur, 4px));
    -webkit-backdrop-filter: blur(var(--dl-cart-blur, 4px));
    opacity: 0;
    transition: var(--dl-cart-out, 400ms) opacity;
}

.dl-side-cart.is-active .side-cart-overlay { 
    opacity: 1; 
    transition: var(--dl-cart-in, 400ms) opacity;
}

.side-cart-content {
    position: absolute;
    top: 0; right: -400px;
    width: 400px; max-width: 90%; height: 100%;
    background: var(--dl-bg);
    box-shadow: var(--dl-shadow);
    padding: 2rem;
    transition: var(--dl-cart-out, 400ms) right cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.dl-side-cart.is-active .side-cart-content { 
    right: 0; 
    transition: var(--dl-cart-in, 400ms) right cubic-bezier(0.16, 1, 0.3, 1);
}

.side-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dl-line);
}

.close-side-cart {
    background: none; border: none; font-size: 2rem; cursor: pointer;
}

/* ─── Mini Cart – Produktų sąrašas ─── */
.side-cart-body .woocommerce-mini-cart {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-cart-body .woocommerce-mini-cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--dl-line);
    position: relative;
}

.side-cart-body .woocommerce-mini-cart-item a:first-child {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    text-decoration: none;
    color: var(--dl-text);
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.4;
}

.side-cart-body .woocommerce-mini-cart-item img {
    width: 56px !important;
    height: 56px !important;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.side-cart-body .woocommerce-mini-cart-item .quantity {
    font-size: 0.8rem;
    color: var(--dl-muted);
    font-weight: 400;
}

.side-cart-body .woocommerce-mini-cart-item .amount {
    font-weight: 600;
    color: var(--dl-text);
}

/* Pašalinimo mygtukas (×) */
.side-cart-body .woocommerce-mini-cart-item .remove,
.side-cart-body .woocommerce-mini-cart-item .remove_from_cart_button {
    position: absolute;
    top: 0.75rem;
    right: 0;
    width: 24px;
    height: 24px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    color: var(--dl-muted) !important;
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1;
}

.side-cart-body .woocommerce-mini-cart-item .remove:hover,
.side-cart-body .woocommerce-mini-cart-item .remove_from_cart_button:hover {
    background: #e74c3c;
    color: #fff !important;
}

/* ─── Mini Cart – Bendra suma ─── */
.side-cart-body .woocommerce-mini-cart__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    border-top: 2px solid var(--dl-line);
}

.side-cart-body .woocommerce-mini-cart__total .amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dl-text);
}

/* ─── Mini Cart – Mygtukai ─── */
.side-cart-body .woocommerce-mini-cart__buttons {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding-top: 0.5rem;
}

.side-cart-body .woocommerce-mini-cart__buttons .button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    letter-spacing: 0.02em;
}

/* Peržiūrėti krepšelį – outline stilius */
.side-cart-body .woocommerce-mini-cart__buttons .button.wc-forward:first-child {
    background: transparent;
    color: var(--dl-text);
    border: 2px solid var(--dl-line);
}

.side-cart-body .woocommerce-mini-cart__buttons .button.wc-forward:first-child:hover {
    background: var(--dl-bg-soft);
    border-color: var(--dl-muted);
    transform: translateY(-1px);
}

/* Apmokėti – pirminis (filled) stilius */
.side-cart-body .woocommerce-mini-cart__buttons .button.checkout {
    background: #7b5556;
    color: #fff;
    border-color: #7b5556;
    box-shadow: 0 4px 16px rgba(123, 85, 86, 0.25);
}

.side-cart-body .woocommerce-mini-cart__buttons .button.checkout:hover {
    background: #6e494a;
    border-color: #6e494a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(123, 85, 86, 0.35);
}

/* ─── Mini Cart – Tuščias krepšelis ─── */
.side-cart-body .woocommerce-mini-cart__empty-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--dl-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ─── Free Shipping Progress Bar (krepšelyje) ─── */
.free-shipping-bar-container {
    font-family: var(--dl-font-body, inherit);
}


/* Mobile Bottom Nav */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--dl-line);
    z-index: 1000;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.05);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--dl-muted);
}

.mobile-bottom-nav .icon { font-size: 1.2rem; }

@media (min-width: 768px) {
    .mobile-bottom-nav { display: none; }
}

@media (max-width: 767px) {
    .site-footer { padding-bottom: 80px; }
}

/* Bento Grid Pattern for WooCommerce */
.bento-enabled .products {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .bento-enabled .products {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 250px;
    }
    
    .bento-enabled .products li.product {
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        position: relative;
        overflow: hidden;
        padding: 2rem !important;
        border: none;
    }

    /* Target specific products to build the Bento layout */
    .bento-enabled .products li.product:nth-child(1) { grid-column: span 2; grid-row: span 2; }
    .bento-enabled .products li.product:nth-child(2) { grid-column: span 2; grid-row: span 1; }
    .bento-enabled .products li.product:nth-child(3),
    .bento-enabled .products li.product:nth-child(4) { grid-column: span 1; grid-row: span 1; }

    /* Bento Image styling */
    .bento-enabled .products li.product > a img {
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        object-fit: cover !important;
        z-index: 0;
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        margin: 0 !important;
    }
    
    .bento-enabled .products li.product:hover > a img {
        transform: scale(1.05);
    }

    /* Bento overlay for readability */
    .bento-enabled .products li.product::before {
        content: '';
        position: absolute;
        bottom: 0; left: 0; right: 0; height: 60%;
        background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
        z-index: 1;
        pointer-events: none;
    }

    /* Float text to the front */
    .bento-enabled .products li.product > a > .woocommerce-loop-product__title,
    .bento-enabled .products li.product > a > .price,
    .bento-enabled .products li.product > .button {
        position: relative;
        z-index: 2;
        color: #fff;
    }
    
    .bento-enabled .products li.product > a > .price { margin-bottom: 1rem; }
    .bento-enabled .products li.product > .button {
        align-self: flex-start;
        background: rgba(255,255,255,0.2) !important;
        backdrop-filter: blur(5px);
        color: #fff !important;
    }
    .bento-enabled .products li.product > .button:hover {
        background: var(--dl-text) !important;
    }
    }
}

/* =========================================
   PREMIUM E-COMMERCE FEATURES 
   ========================================= */

/* 1. Scroll Animations (AoS) */
.dl-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.dl-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 2. Hover Swap Image */
.woocommerce ul.products li.product > a { 
    position: relative; 
    display: block; 
    overflow: hidden; 
}
.woocommerce ul.products li.product .hover-image {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%; 
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 10;
}
.woocommerce ul.products li.product:hover .hover-image {
    opacity: 1;
}

/* 3. Sticky Add To Cart */
.dl-sticky-atc {
    position: fixed; 
    top: 0; left: 0; right: 0; height: 70px;
    background: rgba(255,255,255,0.95); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); 
    z-index: 1050;
    transform: translateY(-100%); 
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.dl-sticky-atc.is-visible { 
    transform: translateY(0); 
}
@media(max-width: 767px) {
    .dl-sticky-atc { 
        top: auto; bottom: 70px; /* Sits above the mobile nav */
        transform: translateY(100%); 
        border-top: 1px solid var(--dl-line); 
    }
    .dl-sticky-atc .sticky-title { display: none; }
}
