/*
Theme Name: RoyalDigi Theme
Description: قالب فارسی فروشگاه رویال‌دیجی برای آزمایش با ووکامرس.
Version: 0.3.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: royaldigi-theme
*/

:root {
    --rd-ink: #102c45;
    --rd-muted: #52677b;
    --rd-blue: #04518d;
    --rd-deep: #052f54;
    --rd-yellow: #f9c700;
    --rd-line: #dce6ed;
    --rd-surface: #fff;
    --rd-bg: #f4f7fa;
    --rd-radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--rd-bg); color: var(--rd-ink); font: 15px/1.85 Tahoma, Arial, sans-serif; }
a { color: var(--rd-blue); text-underline-offset: .2em; }
a:hover { color: var(--rd-deep); }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { line-height: 1.5; }
h1 { font-size: clamp(1.55rem, 3vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 2.3vw, 1.7rem); }
:focus-visible { outline: 3px solid #ba7400; outline-offset: 4px; }
.rd-container { width: min(100% - 36px, 1320px); margin-inline: auto; }

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.rd-skip:focus {
    z-index: 10;
    width: auto;
    height: auto;
    clip-path: none;
    padding: .6rem 1rem;
    background: white;
}

.rd-header { background: var(--rd-surface); }
.rd-header-main {
    display: grid;
    grid-template-columns: minmax(100px, 160px) minmax(160px, 1fr) auto;
    align-items: center;
    gap: clamp(14px, 3vw, 42px);
    padding-block: 18px;
}
.rd-brand img { width: min(100%, 148px); }
.rd-search { display: flex; border: 1px solid var(--rd-line); border-radius: 12px; background: var(--rd-bg); }
.rd-search input { width: 100%; min-width: 0; border: 0; background: transparent; padding: .65rem .85rem; color: var(--rd-ink); }
.rd-search button {
    flex: none;
    border: 0;
    border-start-end-radius: 11px;
    border-end-end-radius: 11px;
    background: var(--rd-blue);
    color: #fff;
    padding: .55rem .9rem;
    cursor: pointer;
}
.rd-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-header-actions a { border: 1px solid var(--rd-line); border-radius: 10px; padding: .35rem .7rem; text-decoration: none; }
.rd-nav { background: var(--rd-deep); color: white; }
.rd-nav ul, .rd-footer ul { list-style: none; margin: 0; padding: 0; }
.rd-nav .rd-container > ul { display: flex; flex-wrap: wrap; gap: 0 22px; }
.rd-nav li { position: relative; }
.rd-nav a { display: block; padding: .65rem .15rem; color: white; text-decoration: none; }
.rd-nav a:hover, .rd-nav .current-menu-item > a { color: var(--rd-yellow); }
.rd-nav .sub-menu {
    display: none;
    position: absolute;
    z-index: 3;
    inset-inline-start: 0;
    min-width: max-content;
    padding-inline: .8rem;
    background: var(--rd-deep);
}
.rd-nav li:hover > .sub-menu, .rd-nav li:focus-within > .sub-menu { display: block; }

.rd-home { padding-block: 26px 50px; }
.rd-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    min-height: 350px;
    overflow: hidden;
    isolation: isolate;
    border-radius: 24px;
    color: white;
    background: radial-gradient(ellipse at 24% 52%, #166dab, var(--rd-blue) 65%, var(--rd-deep));
}
.rd-hero-copy { padding: clamp(24px, 5vw, 64px); }
.rd-hero-copy h1 { margin: .45rem 0; }
.rd-hero-copy p { margin: .5rem 0 1.3rem; color: #e2f0fb; }
.rd-eyebrow { color: #b7dff5; font-size: .79rem; font-weight: bold; letter-spacing: .08em; }
.rd-hero-img { width: min(43vw, 525px); justify-self: center; object-fit: contain; }
.rd-button { display: inline-block; padding: .65rem 1.1rem; border-radius: 999px; font-weight: bold; text-decoration: none; }
.rd-button-yellow, .rd-button-yellow:hover { color: var(--rd-deep); background: var(--rd-yellow); }

.rd-section { margin-block: 38px; }
.rd-section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 16px; }
.rd-section-heading h2 { margin: 0; }
.rd-categories, .rd-articles, .rd-assurances { display: grid; gap: 14px; }
.rd-categories { grid-template-columns: repeat(8, minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; }
.rd-categories a, .rd-card, .rd-trust li {
    display: block;
    height: 100%;
    border: 1px solid var(--rd-line);
    border-radius: var(--rd-radius);
    background: var(--rd-surface);
}
.rd-categories a { display: grid; align-content: center; justify-items: center; gap: 5px; padding: 12px 5px; text-align: center; text-decoration: none; }
.rd-categories img { object-fit: contain; aspect-ratio: 1; }
.rd-categories a:hover, .rd-card:hover { border-color: var(--rd-blue); }
.rd-articles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rd-card { overflow: hidden; }
.rd-card a { display: block; color: inherit; text-decoration: none; }
.rd-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.rd-card h2, .rd-card h3 { margin: 0; padding: 14px 16px; font-size: 1rem; }
.rd-pocket {
    display: grid;
    grid-template-columns: 1fr minmax(90px, 36%);
    align-items: center;
    gap: 12px;
    padding: clamp(18px, 4vw, 40px);
    border-radius: var(--rd-radius);
    background: var(--rd-deep);
    color: white;
}
.rd-pocket h2 { margin: 0; }
.rd-pocket p { color: #d5e7f4; }
.rd-pocket img { width: min(100%, 240px); justify-self: center; }

.rd-trust { grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; padding: 0; }
.rd-trust li { padding: 15px; }
.rd-trust p, .rd-section-heading p { margin: .35rem 0 0; color: var(--rd-muted); }
.rd-promos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rd-popular details { margin-block: 8px; border: 1px solid var(--rd-line); border-radius: 12px; background: var(--rd-surface); }
.rd-popular summary { padding: 12px 15px; font-weight: bold; cursor: pointer; }
.rd-popular details > .woocommerce { padding-inline: 14px; }
.rd-spotlight img { padding: 14px; object-fit: contain; }

.rd-document, .rd-store { min-height: 55vh; padding-block: 26px 44px; }
.rd-document > article, .rd-post { padding: clamp(14px, 3vw, 32px); border-radius: var(--rd-radius); background: var(--rd-surface); }
.rd-post > article { max-width: 860px; margin-inline: auto; }
.rd-footer { color: white; background: var(--rd-deep); padding-block: 25px; }
.rd-footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.rd-footer p { margin: .2rem 0; color: #c4ddec; }
.rd-footer ul { display: flex; flex-wrap: wrap; gap: 5px 16px; }
.rd-footer a { color: white; }

.woocommerce ul.products li.product {
    position: relative;
    padding: 14px;
    border: 1px solid var(--rd-line);
    border-radius: var(--rd-radius);
    background: var(--rd-surface);
}
.rd-condition-badge {
    position: absolute;
    inset-block-start: 10px;
    inset-inline-start: 10px;
    z-index: 1;
    padding: .18em .65em;
    border: 1px solid #a6d3c1;
    border-radius: 999px;
    background: #e6f5ee;
    color: #184b39;
    font-size: .78rem;
    font-weight: bold;
}
.rd-condition-stock, .rd-condition-like-new { border-color: #e8d19a; background: #fff5db; color: #6c4513; }
.woocommerce ul.products li.product a img { aspect-ratio: 1; object-fit: contain; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { color: var(--rd-ink); line-height: 1.65; }
.woocommerce div.product p.price, .woocommerce ul.products li.product .price { color: var(--rd-blue); font-weight: bold; }
.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button,
.woocommerce input.button, .woocommerce .button.alt { border-radius: 9px; background: var(--rd-blue); color: white; }
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,
.woocommerce .button.alt:hover { background: var(--rd-deep); color: white; }
.woocommerce div.product div.summary, .woocommerce div.product div.images, .woocommerce div.product .woocommerce-tabs {
    padding: clamp(14px, 3vw, 25px);
    border-radius: var(--rd-radius);
    background: var(--rd-surface);
}
.woocommerce input.input-text, .woocommerce select, .woocommerce textarea {
    padding: .45rem .6rem;
    border: 1px solid var(--rd-line);
    border-radius: 8px;
}
.rd-product-panel { margin-block: 1rem; padding: 14px; border: 1px solid var(--rd-line); border-radius: 12px; background: var(--rd-bg); }
.rd-product-panel h2 { margin: 0 0 .4rem; font-size: 1rem; }
.rd-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; }
.rd-specs > div { min-width: 0; padding: 8px; border-radius: 7px; background: white; }
.rd-specs dt { color: var(--rd-muted); font-size: .79rem; }
.rd-specs dd { margin: 0; overflow-wrap: anywhere; font-weight: bold; }
.rd-product-contact p { margin: .25rem 0 .55rem; color: var(--rd-muted); }
.rd-contact-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding-block: 5px; }
.rd-contact-row a { border: 1px solid var(--rd-line); border-radius: 8px; padding: 3px 8px; background: white; text-decoration: none; }

@media (max-width: 960px) {
    .rd-categories { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .rd-container { width: calc(100% - 24px); }
    .rd-header-main { grid-template-columns: minmax(72px, 130px) 1fr; gap: 10px; padding-block: 12px; }
    .rd-search { grid-column: 1 / -1; grid-row: 2; }
    .rd-header-actions { justify-content: end; font-size: .78rem; }
    .rd-nav .rd-container > ul { gap: 0 14px; }
    .rd-nav a { padding-block: .45rem; }
    .rd-home { padding-top: 14px; }
    .rd-hero { grid-template-columns: 1fr; text-align: center; }
    .rd-hero-copy { padding-bottom: 0; }
    .rd-hero-img { width: 82vw; }
    .rd-categories { gap: 8px; font-size: .78rem; }
    .rd-categories img { width: 52px; }
    .rd-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .rd-promos { grid-template-columns: 1fr; }
    .rd-articles { grid-template-columns: 1fr; }
}

/* RoyalDigi storefront layout */
@font-face {
    font-family: "Yekan Bakh FA";
    src: url("assets/yekan-regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Yekan Bakh FA";
    src: url("assets/yekan-bold.woff2") format("woff2");
    font-weight: 600 900;
    font-display: swap;
}

:root {
    --rd-blue: #074377;
    --rd-deep: #052f54;
    --rd-yellow: #ffcc00;
    --rd-bg: #eff1f5;
}
body { font-family: "Yekan Bakh FA", Tahoma, Arial, sans-serif; font-size: 14px; }
.rd-container { width: min(100% - 36px, 1290px); }

.rd-header-note {
    display: grid;
    min-height: 40px;
    place-items: center;
    padding-inline: 16px;
    background: var(--rd-blue);
    color: white;
    text-align: center;
}
.rd-header-body { border-bottom: 1px solid #eee; }
.rd-header-main {
    grid-template-columns: 150px minmax(180px, 1fr) auto;
    min-height: 90px;
    gap: 24px;
    padding-block: 8px;
}
.rd-brand img { width: 150px; }
.rd-search {
    align-items: center;
    min-height: 48px;
    max-width: 550px;
    border: 1px solid #e7e7e7;
    border-radius: 100px;
    background: #fff;
}
.rd-search input { padding-inline: 16px 3px; }
.rd-search button { width: 46px; height: 42px; padding: 10px; border-radius: 50%; background: transparent; color: #222; }
.rd-search svg, .rd-header-actions svg, .rd-mobile-menu svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.rd-header-actions { align-items: center; gap: 16px; }
.rd-header-actions a { display: inline-flex; align-items: center; padding: 0; border: 0; color: #292929; }
.rd-list-link, .rd-account { display: inline-flex; align-items: center; justify-content: center; width: 31px; min-height: 38px; }
.rd-header-actions .rd-cart { gap: 8px; min-height: 43px; padding: 4px 6px 4px 14px; border-radius: 999px; color: white; background: var(--rd-blue); }
.rd-cart-icon { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 100%; background: #fff; }
.rd-cart-icon small { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 15px; border-radius: 999px; background: var(--rd-yellow); color: #282828; text-align: center; font-size: 10px; }
.rd-nav { min-height: 50px; background: white; color: #242424; box-shadow: 0 1px 8px #0000001a; }
.rd-nav .rd-container > ul { justify-content: center; align-items: center; gap: 0 27px; min-height: 50px; }
.rd-nav a { color: #242424; font-weight: 600; }
.rd-nav a:hover, .rd-nav .current-menu-item > a { color: var(--rd-blue); }
.rd-nav .sub-menu { background: white; border: 1px solid var(--rd-line); box-shadow: 0 5px 16px #102c451a; }
.rd-mobile-menu { display: none; }

.rd-home { padding-block: 0 40px; }
.rd-home-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 62px;
    padding: 8px 20px;
    background: linear-gradient(90deg,#0e86c7,#074377 56%);
    color: white;
}
.rd-home-strip h1 { margin: 0; font-size: clamp(1rem, 2vw, 1.55rem); font-weight: 600; }
.rd-home-strip a { flex: none; padding: .38em 1.3em; border-radius: 999px; background: var(--rd-yellow); color: var(--rd-blue); text-decoration: none; font-weight: 600; }
.rd-category-strip { margin-top: 20px; }
.rd-categories { gap: 10px; }
.rd-categories a { gap: 6px; padding: 5px 2px; border: 0; border-radius: 0; background: transparent; font-weight: 600; }
.rd-categories a:hover { color: var(--rd-deep); text-decoration: underline; }
.rd-categories img { width: min(100%, 120px); height: 120px; }
.rd-trust-section { margin-block: 20px 24px; padding: 17px 12px; border-radius: 16px; background: #fff; }
.rd-trust-section .rd-section-heading { justify-content: center; color: var(--rd-blue); }
.rd-trust { margin: 0; }
.rd-trust li { text-align: center; }
.rd-special {
    margin-block: 24px 32px;
    padding: 22px 17px 17px;
    border-radius: 17px;
    background: linear-gradient(120deg,#182f97,#074377 56%);
}
.rd-special .rd-section-heading { justify-content: center; text-align: center; }
.rd-special .rd-section-heading h2, .rd-special .rd-section-heading p, .rd-special .rd-section-heading > a { color: #fff; }
.rd-home .rd-special ul.products { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0; }
.rd-home .rd-special ul.products::before, .rd-home .rd-special ul.products::after { display: none; }
.rd-home .rd-special ul.products li.product { float: none; width: auto; margin: 0; }
.rd-popular { padding: 17px; border-radius: 17px; background: white; }
.rd-home-articles {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 42px) / 4);
    padding-bottom: 8px;
    overflow-x: auto;
    scroll-snap-type: inline mandatory;
}
.rd-home-articles > article { scroll-snap-align: start; }

.rd-footer { padding: 0; background: #fff; color: #222; border-top: 1px solid #e4e7eb; }
.rd-footer-perks { background: #074377; color: #fff; }
.rd-footer-perks .rd-container { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; padding-block: 17px; }
.rd-footer-perks span { display: block; color: #edf4fb; }
.rd-footer-inner { display: grid; grid-template-columns: 1.3fr .75fr 1fr; gap: 30px; padding-block: 28px; }
.rd-footer-inner h2 { margin: 0 0 10px; font-size: 1.15rem; color: var(--rd-blue); }
.rd-footer p { color: #4c5661; }
.rd-footer a { color: var(--rd-blue); }
.rd-footer nav ul { display: grid; gap: 7px; }
.rd-footer-contact { display: flex; justify-content: space-between; gap: 12px; padding-block: 4px; border-bottom: 1px solid #eee; }

.single-product .rd-store { width: min(100% - 28px,1440px); }
.single-product .rd-store div.product.type-product {
    display: grid;
    grid-template-columns: minmax(0,1.12fr) minmax(0,1fr) minmax(260px,320px);
    align-items: start;
    gap: 16px;
    padding: 15px;
    border: 1px solid #dee7ef;
    border-radius: 22px;
    background: white;
    box-shadow: 0 12px 38px #132e480b;
}
.single-product .rd-store div.product.type-product::before,
.single-product .rd-store div.product.type-product::after { display: none; }
.single-product .rd-store div.product.type-product > :not(.images, .summary, .onsale) { grid-column: 1 / -1; }
.single-product .rd-store div.product.type-product > .summary { display: contents; }
.single-product .rd-store div.product.type-product > .images { width: auto; min-width: 0; margin: 0; padding: 11px; border: 1px solid #dee7ef; }
.single-product .rd-product-info, .single-product .rd-product-buy { min-width: 0; padding: 14px; border: 1px solid #dee7ef; border-radius: 16px; background: #fff; }
.single-product .rd-product-buy { background: #f5f9fc; }
.single-product .rd-product-info .product_title { margin: 0; color: #1c3045; font-size: clamp(1.15rem, 2.1vw, 1.65rem); }
.single-product .rd-product-buy form.cart { float: none; margin-block: 0 1rem; }
.single-product .rd-product-buy .single_add_to_cart_button { background: var(--rd-blue); }
.single-product .rd-product-info .rd-product-panel { padding-inline: 0; border: 0; background: transparent; }
.single-product .rd-product-info .rd-specs > div { background: #eef6fc; }

@media (max-width: 1024px) {
    .rd-header-main { gap: 13px; }
    .rd-home .rd-special ul.products { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .single-product .rd-store div.product.type-product { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .single-product .rd-product-buy { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
    .rd-container { width: calc(100% - 24px); }
    .rd-header-note, .rd-header > .rd-nav, .rd-header-actions .rd-list-link, .rd-cart-price { display: none; }
    .rd-header-main { position: relative; grid-template-columns: 1fr 130px 1fr; gap: 8px; min-height: 61px; padding-block: 6px 9px; }
    .rd-mobile-menu { display: block; }
    .rd-mobile-menu summary { display: inline-flex; cursor: pointer; list-style: none; }
    .rd-mobile-menu summary::-webkit-details-marker { display: none; }
    .rd-mobile-menu nav { position: absolute; z-index: 3; inset-block-start: 53px; inset-inline-start: 0; min-width: 190px; padding: 10px; border: 1px solid var(--rd-line); border-radius: 10px; background: white; }
    .rd-mobile-menu ul { list-style: none; margin: 0; padding-inline-start: 10px; }
    .rd-mobile-menu nav a { display: block; padding: 4px; }
    .rd-header-actions { gap: 6px; }
    .rd-header-actions .rd-cart { padding: 0; min-height: 36px; background: transparent; }
    .rd-header-main .rd-search { grid-row: 2; grid-column: 1 / -1; max-width: none; min-height: 38px; }
    .rd-search button { height: 36px; padding-block: 6px; }
    .rd-home-strip { min-height: 52px; padding-inline: 8px; }
    .rd-home-strip a { font-size: .83rem; padding-inline: .65em; }
    .rd-categories img { width: 64px; height: 64px; }
    .rd-home .rd-special ul.products { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rd-home-articles { grid-auto-columns: calc((100% - 14px) / 2); }
    .rd-footer-perks .rd-container { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rd-footer-inner { grid-template-columns: 1fr; gap: 18px; }
    .single-product .rd-store div.product.type-product { grid-template-columns: minmax(0,1fr); padding: 9px; gap: 9px; }
    .rd-footer-perks .rd-container { font-size: .86rem; }
}
