/*
Theme Name:        Pannaiyar
Theme URI:         https://pannaiyar.in
Author:            Technick Soft Solutions
Author URI:        https://technicksoft.com
Description:       Premium product showcase theme for Pannaiyar - Traditional Touch. Multilingual, responsive, PWA-ready.
Version:           1.0.0
Requires at least: 6.0
Tested up to:      6.7
Requires PHP:      8.0
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       pannaiyar
Tags:              custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   CSS CUSTOM PROPERTIES — Design Tokens
   ========================================================================== */

:root {
    /* Brand Colors — Chinese Orange (60%) */
    --primary: #ff6f00;
    --primary-dark: #ff6f00;
    --primary-light: #ff6f00;
    --primary-rgb: 240, 118, 33;

    /* In-Between Section — Royal Orange */
    --royal-orange: #ff6f00;
    --royal-orange-rgb: 255, 153, 68;

    --accent-gold: #fac73b;
    --accent-gold-dark: #fac73b;

    --white: #FFFFFF;
    --cream: #FFFCF5;
    --text-dark: #1A1A2E;
    --text-muted: #4A4A5A;
    --text-light: #7A7A8A;

    /* CTA Button — Flame */
    --btn-cta: #ff2f00;
    --btn-cta-dark: #c92500;
    --btn-cta-rgb: 227, 74, 39;

    /* Functional Colors */
    --border: rgba(212, 146, 42, 0.2);
    --border-light: rgba(212, 146, 42, 0.08);
    --shadow: 0 8px 32px rgba(212, 146, 42, 0.15);
    --shadow-sm: 0 2px 8px rgba(212, 146, 42, 0.1);
    --shadow-lg: 0 20px 60px rgba(212, 146, 42, 0.2);
    --shadow-card: 0 4px 16px rgba(26, 26, 46, 0.08);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 80px;
    --space-5xl: 120px;

    /* Border Radius */
    --radius: 12px;
    --radius-sm: 6px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 50%;
    --radius-pill: 100px;

    /* Typography Scale (fluid) */
    --fs-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
    --fs-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.9rem);
    --fs-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
    --fs-md: clamp(1.05rem, 0.95rem + 0.5vw, 1.2rem);
    --fs-lg: clamp(1.2rem, 1rem + 1vw, 1.5rem);
    --fs-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    --fs-2xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);
    --fs-3xl: clamp(2.5rem, 1.8rem + 3.5vw, 4rem);
    --fs-hero: clamp(2.8rem, 2rem + 4vw, 5rem);

    /* Font Families */
    --ff-display: 'Playfair Display', Georgia, serif;
    --ff-body: 'Nunito', 'Segoe UI', sans-serif;
    --ff-accent: 'Cinzel', Georgia, serif;

    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Layout */
    --header-h: 80px;
    --header-h-compact: 64px;
    --container-max: 1280px;
    --container-narrow: 960px;
    --container-wide: 1400px;

    /* Z-index layers */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-overlay: 900;
    --z-modal: 1000;
    --z-toast: 1100;
    --z-fab: 1200;
}


/* ==========================================================================
   CSS RESET / NORMALIZE
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    line-height: 1.6;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: var(--ff-body);
    font-size: var(--fs-base);
    color: var(--text-dark);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
    min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--ff-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
    overflow-wrap: break-word;
}

p {
    overflow-wrap: break-word;
    line-height: 1.8;
    color: var(--text-muted);
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

::selection {
    background-color: var(--primary);
    color: var(--white);
}


/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

.heading-hero {
    font-family: var(--ff-display);
    font-size: var(--fs-hero);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.heading-1 {
    font-size: var(--fs-3xl);
    letter-spacing: -0.01em;
}

.heading-2 {
    font-size: var(--fs-2xl);
}

.heading-3 {
    font-size: var(--fs-xl);
}

.heading-4 {
    font-size: var(--fs-lg);
}

.heading-5 {
    font-size: var(--fs-md);
}

.text-accent {
    font-family: var(--ff-accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.text-muted {
    color: var(--text-muted);
}

.text-light {
    color: var(--text-light);
}

.text-white {
    color: var(--white);
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-gold {
    color: var(--accent-gold);
}


/* ==========================================================================
   LAYOUT — Containers & Grid
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

.section {
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-4xl);
}

.section--lg {
    padding-top: var(--space-5xl);
    padding-bottom: var(--space-5xl);
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.flex {
    display: flex;
}

.flex--center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex--between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex--column {
    flex-direction: column;
}

.flex--wrap {
    flex-wrap: wrap;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.gap-xl {
    gap: var(--space-xl);
}

.gap-2xl {
    gap: var(--space-2xl);
}


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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 32px;
    font-family: var(--ff-body);
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    min-height: 44px;
    min-width: 44px;
    text-decoration: none;
    line-height: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: width 0.6s ease, height 0.6s ease, top 0.6s ease, left 0.6s ease;
    transform: translate(-50%, -50%);
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Primary Button — White bg on orange sections */
.btn-primary {
    background: var(--white);
    color: var(--btn-cta);
    border-color: var(--white);
}

.btn-primary:hover {
    background: var(--cream);
    color: var(--btn-cta-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.3);
}

/* CTA Button — Burnt orange-red (primary action) */
.btn-orange {
    background: var(--btn-cta);
    color: var(--white);
    border-color: var(--btn-cta);
}

.btn-orange:hover {
    background: var(--btn-cta-dark);
    border-color: var(--btn-cta-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--btn-cta-rgb), 0.3);
}

/* Gold Button */
.btn-gold {
    background: var(--accent-gold);
    color: var(--text-dark);
    border-color: var(--accent-gold);
}

.btn-gold:hover {
    background: var(--accent-gold-dark);
    border-color: var(--accent-gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 166, 35, 0.3);
}

/* Outline CTA */
.btn-outline {
    background: transparent;
    color: var(--btn-cta);
    border-color: var(--btn-cta);
}

.btn-outline:hover {
    background: var(--btn-cta);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--btn-cta-rgb), 0.3);
}

/* Outline White */
.btn-outline-white {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline-white:hover {
    background: var(--white);
    color: var(--btn-cta);
    transform: translateY(-2px);
}

/* Button Sizes */
.btn--sm {
    padding: 10px 20px;
    font-size: var(--fs-xs);
}

.btn--lg {
    padding: 18px 40px;
    font-size: var(--fs-base);
}

.btn--full {
    width: 100%;
}


/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-dark);
}

.form-label .required {
    color: var(--primary);
    margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 14px 18px;
    font-size: var(--fs-base);
    color: var(--text-dark);
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
}

.form-textarea {
    resize: vertical;
    min-height: 140px;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234A4A5A' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-message {
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    font-weight: 600;
    margin-top: var(--space-md);
    display: none;
}

.form-message--success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
    display: block;
}

.form-message--error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}


/* ==========================================================================
   SECTION TITLES
   ========================================================================== */

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-subtitle {
    font-family: var(--ff-accent);
    font-size: 20px; /* (Your new size) */
    font-weight: bold; /* <--- Add this line here */
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: black; /* (Your new color) */
    margin-bottom: var(--space-sm);
    display: block;
}


.section-title {
    font-family: var(--ff-display);
    font-size: var(--fs-2xl);
    color: var(--text-dark);
    margin-bottom: var(--space-md);
    position: relative;
}

.section-title--white {
    color: var(--white);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-gold);
    margin: var(--space-md) auto 0;
    border-radius: var(--radius-pill);
}

.section-title--left::after {
    margin-left: 0;
}

.section-desc {
    font-size: var(--fs-md);
    color: var(--text-muted);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.section-desc--white {
    color: rgba(255, 255, 255, 0.85);
}


/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 4px 14px;
    font-size: var(--fs-xs);
    font-weight: 700;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge--orange {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.badge--gold {
    background: rgba(245, 166, 35, 0.15);
    color: var(--accent-gold-dark);
}

.badge--white {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}


/* ==========================================================================
   TRADITIONAL SVG PATTERNS
   ========================================================================== */

.pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.5' fill='%23FFFFFF' fill-opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

.pattern-overlay--dark {
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.5' fill='%23D4922A' fill-opacity='1'/%3E%3C/svg%3E");
}


/* ==========================================================================
   SECTION DIVIDERS
   ========================================================================== */

.section-divider {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    position: relative;
    z-index: 2;
}

.section-divider svg {
    display: block;
    width: 100%;
    height: 40px;
}

.section-divider--flip {
    transform: rotate(180deg);
}

.section-divider--orange svg path {
    fill: var(--primary);
}

.section-divider--cream svg path {
    fill: var(--cream);
}

.section-divider--dark svg path {
    fill: var(--text-dark);
}

.section-divider--white svg path {
    fill: var(--white);
}


/* ==========================================================================
   PAGE HERO (Inner Pages)
   ========================================================================== */

.page-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: calc(var(--header-h) + var(--space-3xl)) 0 var(--space-3xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero .pattern-overlay {
    opacity: 0.08;
}

.page-hero__title {
    font-family: var(--ff-display);
    font-size: var(--fs-2xl);
    color: var(--white);
    margin-bottom: var(--space-md);
}

.page-hero__breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.7);
}

.page-hero__breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition-fast);
}

.page-hero__breadcrumb a:hover {
    color: var(--white);
}

.page-hero__breadcrumb .separator {
    color: rgba(255, 255, 255, 0.4);
}

.page-hero__breadcrumb .current {
    color: var(--accent-gold);
    font-weight: 600;
}


/* ==========================================================================
   BACKGROUND HELPERS
   ========================================================================== */

.bg-primary {
    background-color: var(--primary);
}

.bg-primary-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.bg-dark {
    background-color: #1A1A2E;
}

.bg-cream {
    background-color: var(--cream);
}

.bg-white {
    background-color: var(--white);
}

.bg-tint {
    background-color: rgba(var(--primary-rgb), 0.04);
}

.bg-gold-gradient {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFE0A0 100%);
}

.bg-cream-warm {
    background: linear-gradient(135deg, #FFFCF0 0%, #FFF3D6 100%);
}


/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--primary);
    color: var(--white);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: var(--z-toast);
    transition: var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}


/* ==========================================================================
   WORDPRESS CORE OVERRIDES
   ========================================================================== */

.wp-caption {
    max-width: 100%;
    margin-bottom: var(--space-lg);
}

.wp-caption-text {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    text-align: center;
    padding-top: var(--space-sm);
}

.alignleft {
    float: left;
    margin-right: var(--space-lg);
    margin-bottom: var(--space-md);
}

.alignright {
    float: right;
    margin-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-lg);
}

.entry-content>*+* {
    margin-top: var(--space-lg);
}

.entry-content h2 {
    margin-top: var(--space-2xl);
}

.entry-content h3 {
    margin-top: var(--space-xl);
}

.entry-content ul,
.entry-content ol {
    padding-left: var(--space-lg);
}

.entry-content ul {
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content a {
    color: var(--primary);
    text-decoration: underline;
    transition: var(--transition-fast);
}

.entry-content a:hover {
    color: var(--primary-dark);
}

.entry-content blockquote {
    border-left: 4px solid var(--accent-gold);
    padding: var(--space-lg);
    background: var(--cream);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-muted);
}


/* ==========================================================================
   GRAIN TEXTURE UTILITY
   ========================================================================== */

.grain-texture::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ==========================================================================
   PAGE LOADER
   ========================================================================== */

.pn-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background-color: #f7f1e3;
    background-image: url('assets/images/loader-bg.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.pn-page-loader.pn-loaded {
    opacity: 0;
    visibility: hidden;
}

.pn-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 12vh;
}

.pn-loader-logo h2 {
    font-size: 32px;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.pn-loader-logo img {
    max-width: 180px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.1));
}

.pn-loader-greeting {
    font-family: var(--ff-display);
    font-size: 28px;
    color: var(--text-dark);
    font-weight: 700;
    text-align: center;
    margin-top: 15px;
}

.pn-loader-footer {
    text-align: center;
    font-family: var(--ff-body);
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 28vh;
}

.pn-loader-footer strong {
    font-size: 16px;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .pn-loader-content {
        margin-top: 15vh;
    }

    .pn-loader-footer {
        margin-bottom: 30vh;
    }
}

/* ==========================================================================
   RESPONSIVE GRID
   ========================================================================== */
@media (max-width: 992px) {

    .grid--3,
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }

    .flex--between {
        flex-direction: column;
        align-items: flex-start;
    }

    .products-toolbar {
        flex-direction: column;
    }

    .products-search {
        width: 100%;
        max-width: 100%;
    }
}

/* ==========================================================================
   ROYAL ORANGE BACKGROUND
   ========================================================================== */
.bg-royal {
    background-color: var(--royal-orange);
    color: var(--white);
}

.bg-royal .section-title,
.bg-royal .section-eyebrow,
.bg-royal h1,
.bg-royal h2,
.bg-royal h3,
.bg-royal h4,
.bg-royal p {
    color: var(--white) !important;
}