/*
Theme Name: Ramiarz
Theme URI: https://ramiarz.pl
Author: Ramiarz
Description: Motyw sklepu Ramiarz — ramki na wymiar. Design system wood-inspired + gallery aesthetics. WooCommerce z customowym konfiguratorem.
Version: 1.5.3
Requires at least: 6.3
Tested up to: 6.6
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: ramiarz
*/

/* ============================================================================
   DESIGN TOKENS — 1:1 z index.css źródła Lovable
   ============================================================================ */

:root {
    /* Wood colors */
    --oak: 40 50% 57%;           /* #C6A15B */
    --oak-hover: 40 53% 46%;     /* #A8843F */
    --pine: 43 53% 77%;          /* #E6D3A3 */
    --ebony: 60 5% 12%;          /* #1F1F1D */
    --gallery-gray: 60 2% 71%;   /* #B6B6B2 */

    /* Surfaces */
    --background: 43 25% 96%;    /* #F7F6F3 */
    --foreground: 60 5% 12%;
    --card: 43 25% 96%;
    --card-foreground: 60 5% 12%;

    /* UI semantics */
    --primary: 60 5% 12%;
    --primary-foreground: 43 25% 96%;
    --secondary: 40 50% 57%;
    --secondary-foreground: 0 0% 100%;
    --muted: 40 10% 92%;
    --muted-foreground: 60 3% 45%;
    --accent: 43 53% 77%;
    --accent-foreground: 60 5% 12%;
    --destructive: 7 55% 47%;
    --destructive-foreground: 0 0% 100%;
    --success: 150 37% 36%;
    --success-foreground: 0 0% 100%;
    --border: 50 12% 86%;
    --input: 50 12% 86%;
    --ring: 40 50% 57%;

    /* Geometry */
    --radius: 0.25rem;
    --header-height: 7rem;       /* top bar + main header */
    --container-max: 1400px;

    /* Typography */
    --font-display: "Playfair Display", Georgia, serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "DM Sans", ui-monospace, monospace;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 hsl(60 5% 12% / 0.03);
    --shadow-md: 0 4px 6px -1px hsl(60 5% 12% / 0.05), 0 2px 4px -2px hsl(60 5% 12% / 0.03);
    --shadow-lg: 0 10px 15px -3px hsl(60 5% 12% / 0.05), 0 4px 6px -4px hsl(60 5% 12% / 0.03);
    --shadow-frame: 0 25px 50px -12px hsl(60 5% 12% / 0.12);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-padding-top: var(--header-height);
}

body {
    margin: 0;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--transition-base); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 0.5em;
    color: hsl(var(--foreground));
}
h1 { font-size: clamp(2rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; }

::selection { background: hsl(var(--oak) / 0.25); color: hsl(var(--ebony)); }

:focus-visible {
    outline: 2px solid hsl(var(--oak));
    outline-offset: 2px;
}

/* ============================================================================
   LAYOUT UTILITIES
   ============================================================================ */

.container-custom {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 640px) { .container-custom { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container-custom { padding: 0 2rem; } }

.section-padding {
    padding: 4rem 0;
}
@media (min-width: 768px) { .section-padding { padding: 6rem 0; } }
@media (min-width: 1024px) { .section-padding { padding: 8rem 0; } }

.accent-line {
    width: 4rem;
    height: 2px;
    background: hsl(var(--oak));
    display: block;
}

.divider { height: 1px; background: hsl(var(--border)); width: 100%; border: 0; }

.dimension {
    font-family: var(--font-mono);
    font-weight: 600;
    color: hsl(var(--gallery-gray));
}

.price {
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: var(--radius);
    transition: all var(--transition-base);
    text-align: center;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.btn--xl { padding: 1rem 2.25rem; font-size: 1rem; }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

.btn--primary {
    background: hsl(var(--ebony));
    color: hsl(var(--background));
}
.btn--primary:hover { background: hsl(var(--oak)); color: hsl(var(--background)); }

.btn--oak {
    background: hsl(var(--oak));
    color: #fff;
}
.btn--oak:hover { background: hsl(var(--oak-hover)); }

.btn--outline {
    background: transparent;
    border: 1.5px solid hsl(var(--ebony));
    color: hsl(var(--ebony));
}
.btn--outline:hover { background: hsl(var(--ebony)); color: hsl(var(--background)); }

.btn--ghost {
    background: transparent;
    color: hsl(var(--foreground));
}
.btn--ghost:hover { color: hsl(var(--oak)); }

.btn--icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: var(--radius);
}
.btn--icon:hover { background: hsl(var(--muted)); }

.btn svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }

/* ============================================================================
   FORMS
   ============================================================================ */

.input-field,
input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], input[type="password"], input[type="search"],
input[type="url"], textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    transition: all var(--transition-base);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: hsl(var(--foreground));
}
.input-field:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: hsl(var(--oak));
    box-shadow: 0 0 0 3px hsl(var(--oak) / 0.15);
}
.input-field::placeholder, input::placeholder, textarea::placeholder {
    color: hsl(var(--muted-foreground));
}

.label-field, label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
}

/* ============================================================================
   HEADER
   ============================================================================ */

.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    background: hsl(var(--background) / 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid hsl(var(--border));
}

.site-header__topbar {
    background: hsl(var(--ebony));
    color: hsl(var(--background));
    font-size: 0.8125rem;
    padding: 0.5rem 0;
}
.site-header__topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.site-header__topbar a:hover { color: hsl(var(--oak)); }
.site-header__topbar-phone { display: inline-flex; align-items: center; gap: 0.5rem; }
.site-header__topbar-phone svg { width: 0.75rem; height: 0.75rem; }
.site-header__topbar-info { color: hsl(var(--background) / 0.8); }
.site-header__topbar-info--shipping { display: none; }
@media (min-width: 640px) { .site-header__topbar-info--shipping { display: block; } }

.site-header__main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5rem;
    gap: 1rem;
}

.site-logo { display: flex; align-items: center; gap: 0.75rem; }
.site-logo__mark {
    width: 2.5rem; height: 2.5rem;
    background: hsl(var(--oak));
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: hsl(var(--background));
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}
.site-logo__text { display: flex; flex-direction: column; }
.site-logo__name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.site-logo__tag {
    font-size: 0.6875rem;
    color: hsl(var(--muted-foreground));
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-nav {
    display: none;
    align-items: center;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
@media (min-width: 1024px) { .site-nav { display: flex; } }
.site-nav__link {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    position: relative;
    padding: 0.25rem 0;
}
.site-nav__link::after {
    content: "";
    position: absolute;
    left: 0; bottom: -4px;
    height: 2px;
    width: 0;
    background: hsl(var(--oak));
    transition: width var(--transition-base);
}
.site-nav__link:hover, .site-nav__link--active {
    color: hsl(var(--oak));
}
.site-nav__link:hover::after,
.site-nav__link--active::after { width: 100%; }

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.site-header__account-link {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
}
@media (min-width: 640px) { .site-header__account-link { display: inline-flex; } }
.site-header__account-link:hover { color: hsl(var(--oak)); }
.site-header__account-link svg { width: 1.125rem; height: 1.125rem; }
.site-header__account-label { display: none; }
@media (min-width: 768px) { .site-header__account-label { display: inline; } }

.site-header__cart {
    position: relative;
    width: 2.5rem; height: 2.5rem;
    display: inline-flex;
    align-items: center; justify-content: center;
    border-radius: var(--radius);
    transition: background var(--transition-base);
}
.site-header__cart:hover { background: hsl(var(--muted)); }
.site-header__cart svg { width: 1.25rem; height: 1.25rem; }
.site-header__cart-count {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 1.25rem; height: 1.25rem;
    padding: 0 0.25rem;
    background: hsl(var(--oak));
    color: hsl(var(--background));
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    display: flex;
    align-items: center; justify-content: center;
}

.site-header__toggle {
    width: 2.5rem; height: 2.5rem;
    display: inline-flex;
    align-items: center; justify-content: center;
    border-radius: var(--radius);
}
.site-header__toggle:hover { background: hsl(var(--muted)); }
@media (min-width: 1024px) { .site-header__toggle { display: none; } }
.site-header__toggle svg { width: 1.25rem; height: 1.25rem; }
.site-header__toggle .icon-close { display: none; }
.site-header__toggle[aria-expanded="true"] .icon-menu { display: none; }
.site-header__toggle[aria-expanded="true"] .icon-close { display: block; }

.site-mobile-menu {
    display: none;
    background: hsl(var(--background));
    border-top: 1px solid hsl(var(--border));
}
.site-mobile-menu.is-open { display: block; }
.site-mobile-menu__inner {
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
}
.site-mobile-menu__link {
    padding: 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.site-mobile-menu__link:hover,
.site-mobile-menu__link--active { color: hsl(var(--oak)); }
.site-mobile-menu__link svg { width: 1.25rem; height: 1.25rem; }
.site-mobile-menu__divider {
    margin: 0.75rem 0 0.25rem;
    border: 0;
    border-top: 1px solid hsl(var(--border));
}

/* Odsuwa główną treść od fixed headera */
.site-main { padding-top: var(--header-height); }

/* ============================================================================
   FOOTER
   ============================================================================ */

.site-footer {
    background: hsl(var(--ebony));
    color: hsl(var(--background) / 0.8);
    padding: 5rem 0 2rem;
}
.site-footer h4 {
    color: hsl(var(--background));
    font-size: 0.9375rem;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}
.site-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer__brand { max-width: 26rem; }
.site-footer__brand p { color: hsl(var(--background) / 0.7); line-height: 1.7; margin-bottom: 1.5rem; }
.site-footer__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: hsl(var(--background));
    margin-bottom: 1.25rem;
}
.site-footer__logo-name {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
}
.site-footer__contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: hsl(var(--background) / 0.7);
    font-size: 0.9375rem;
}
.site-footer__contact svg { width: 1rem; height: 1rem; margin-top: 0.25rem; color: hsl(var(--oak)); flex-shrink: 0; }
.site-footer__contact a:hover { color: hsl(var(--oak)); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer__links li { margin-bottom: 0.625rem; }
.site-footer__links a { color: hsl(var(--background) / 0.7); font-size: 0.9375rem; }
.site-footer__links a:hover { color: hsl(var(--oak)); }
.site-footer__bottom {
    padding-top: 2rem;
    border-top: 1px solid hsl(var(--background) / 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: hsl(var(--background) / 0.5);
}
@media (min-width: 640px) { .site-footer__bottom { flex-direction: row; } }

/* ============================================================================
   BREADCRUMBS
   ============================================================================ */

.breadcrumbs-bar {
    background: hsl(var(--muted) / 0.3);
    border-bottom: 1px solid hsl(var(--border));
    padding: 1rem 0;
}
.breadcrumbs {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.breadcrumbs a { color: hsl(var(--muted-foreground)); }
.breadcrumbs a:hover { color: hsl(var(--foreground)); }
.breadcrumbs__sep { color: hsl(var(--muted-foreground)); }
.breadcrumbs__current { color: hsl(var(--foreground)); font-weight: 500; }

/* ============================================================================
   ANIMATIONS (CSS replacement for Framer Motion)
   ============================================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.animate-fade-up { animation: fadeUp 0.6s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.4s ease-out forwards; }

/* Scroll-triggered reveals */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal[data-reveal-delay="100"] { transition-delay: 100ms; }
.reveal[data-reveal-delay="200"] { transition-delay: 200ms; }
.reveal[data-reveal-delay="300"] { transition-delay: 300ms; }
.reveal[data-reveal-delay="400"] { transition-delay: 400ms; }
.reveal[data-reveal-delay="500"] { transition-delay: 500ms; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* ============================================================================
   HOVER LIFT
   ============================================================================ */

.hover-lift { transition: transform var(--transition-base), box-shadow var(--transition-base); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ============================================================================
   WOOCOMMERCE OVERRIDES (shortcode-based cart/checkout/account)
   ============================================================================ */

.woocommerce-page .site-main { padding-top: var(--header-height); }

.woocommerce-page .wc-page-hero {
    background: hsl(var(--pine) / 0.2);
    padding: 3rem 0;
    text-align: center;
}
.woocommerce-page .wc-page-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: 0.5rem;
}
.woocommerce-page .wc-page-hero p {
    color: hsl(var(--muted-foreground));
    max-width: 36rem;
    margin: 0 auto;
}

.woocommerce-page .woocommerce {
    padding: 3rem 0 5rem;
}
.woocommerce-page .woocommerce-notices-wrapper { margin-bottom: 1.5rem; }

/* Buttons inside WC */
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce-page button.button,
.woocommerce-page a.button {
    background: hsl(var(--ebony));
    color: hsl(var(--background));
    border-radius: var(--radius);
    padding: 0.75rem 1.75rem;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background var(--transition-base);
    border: none;
    text-shadow: none;
    box-shadow: none;
}
.woocommerce button.button:hover,
.woocommerce a.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
    background: hsl(var(--oak));
    color: hsl(var(--background));
}
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce #place_order,
.woocommerce input.button.alt {
    background: hsl(var(--oak));
    color: #fff;
}
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce #place_order:hover,
.woocommerce input.button.alt:hover {
    background: hsl(var(--oak-hover));
    color: #fff;
}

/* Tables */
.woocommerce table.shop_table {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
}
.woocommerce table.shop_table th {
    background: hsl(var(--muted) / 0.5);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    padding: 1rem;
}
.woocommerce table.shop_table td { padding: 1.25rem 1rem; border-top: 1px solid hsl(var(--border)); }

/* Form rows */
.woocommerce form .form-row label { font-weight: 500; margin-bottom: 0.5rem; }
.woocommerce form .form-row .input-text,
.woocommerce form .form-row select,
.woocommerce-page form .form-row .input-text,
.woocommerce-page form .form-row select {
    padding: 0.75rem 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    width: 100%;
    font-size: 0.9375rem;
}

/* Price format */
.woocommerce .price, .woocommerce-Price-amount {
    font-family: var(--font-mono);
    font-weight: 600;
    color: hsl(var(--foreground));
}

/* Configured frame meta in cart */
.woocommerce-cart-form .product-name dl.variation,
.cart_item dl.variation {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}
.woocommerce-cart-form .product-name dl.variation dt,
.cart_item dl.variation dt {
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-right: 0.25rem;
    display: inline;
}
.woocommerce-cart-form .product-name dl.variation dd,
.cart_item dl.variation dd { display: inline; margin: 0 0 0.25rem; }
/* ============================================================================
   v1.2 — PRZYCISKI WIZUALIZATORA W WOOCOMMERCE
   ============================================================================ */

.ramiarz-visualize-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	text-decoration: none;
	line-height: 1.2;
}
.ramiarz-visualize-btn svg {
	flex-shrink: 0;
}

.woocommerce ul.products li.product .ramiarz-visualize-btn--loop,
.woocommerce-page ul.products li.product .ramiarz-visualize-btn--loop {
	background: hsl(var(--oak));
	color: #fff;
	margin-top: 0.5rem;
	padding: 0.6rem 1.1rem;
	font-size: 0.875rem;
	font-weight: 500;
	border-radius: var(--radius);
	width: auto;
	transition: background var(--transition-base);
}
.woocommerce ul.products li.product .ramiarz-visualize-btn--loop:hover,
.woocommerce-page ul.products li.product .ramiarz-visualize-btn--loop:hover {
	background: hsl(var(--oak-hover));
	color: #fff;
}

.woocommerce div.product .ramiarz-visualize-btn--single {
	background: hsl(var(--oak));
	color: #fff;
	padding: 1rem 2rem;
	font-size: 1rem;
	font-weight: 500;
	border-radius: var(--radius);
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	margin: 1rem 0;
	transition: background var(--transition-base);
}
.woocommerce div.product .ramiarz-visualize-btn--single:hover {
	background: hsl(var(--oak-hover));
	color: #fff;
}
