/* ==========================================================================
   The app's components, as components
   --------------------------------------------------------------------------
   darya.css bends the theme's own classes towards the app. This file is the
   other half: the app's components themselves, so a page can be built out of
   them instead of out of carento's.

   Every value is copied from design/prototype.html. The class names are the
   prototype's too, prefixed `d-` because `.card`, `.row` and `.col` already
   mean something else in Bootstrap and a page uses both.

   Scoped to `.darya-app` so nothing here can reach a page that has not been
   rebuilt yet.
   ========================================================================== */

.darya-app {
    --d-fs-body: 15px;
    --d-fs-sub: 13.5px;
    --d-fs-cap: 12.5px;
    --d-fs-micro: 11.5px;

    color: var(--d-ink);
    font-size: var(--d-fs-body);
    line-height: 1.55;
}

/* the phone is one column; a wide screen gets the same column, centred, with
   the sections that only make sense on a website below it */
.darya-app .d-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.darya-app .d-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.darya-app .d-shell {
    max-width: 720px;
    margin-inline: auto;
    padding: 16px;
}

/* ---- card -------------------------------------------------------------- */
.darya-app .d-card {
    background: var(--d-white);
    border: 1px solid var(--d-edge);
    border-radius: 14px;
    padding: 12px;
}

.darya-app a.d-card,
.darya-app button.d-card {
    display: block;
    width: 100%;
    text-align: start;
    color: inherit;
    text-decoration: none;
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
}

.darya-app a.d-card:hover,
.darya-app button.d-card:hover {
    border-color: var(--d-navy);
}

.darya-app a.d-card:active,
.darya-app button.d-card:active {
    background: var(--d-press);
    transform: scale(.99);
}

/* ---- type -------------------------------------------------------------- */
.darya-app .d-t {
    font-size: var(--d-fs-sub);
    font-weight: 650;
    letter-spacing: -.01em;
    margin: 0;
}

.darya-app h1.d-t {
    font-size: 20px;
    font-weight: 680;
    letter-spacing: -.03em;
    line-height: 1.15;
}

.darya-app .d-sub {
    font-size: var(--d-fs-sub);
    color: var(--d-muted);
    margin: 0;
}

/* ---- button ------------------------------------------------------------ */
.darya-app .d-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    border-radius: 12px;
    background: var(--d-navy);
    color: var(--d-white);
    font-size: 13px;
    font-weight: 650;
    padding: 0 14px;
    border: 0;
    white-space: nowrap;
    line-height: 1.15;
    text-decoration: none;
    transition: transform .1s ease, background-color .12s ease;
}

.darya-app .d-btn:active {
    transform: scale(.985);
}

.darya-app .d-btn:hover {
    background: var(--d-navy-light);
    color: var(--d-white);
}

.darya-app .d-btn.is-ghost {
    background: transparent;
    border: 1px solid var(--d-edge);
    color: var(--d-ink);
}

.darya-app .d-btn.is-brass {
    background: var(--d-gold);
    color: #1B1204;
}

.darya-app .d-btn.is-sm {
    min-height: 32px;
    border-radius: 9px;
    font-size: 11.5px;
    padding: 0 12px;
}

/* ---- field ------------------------------------------------------------- */
.darya-app .d-field {
    border: 1px solid var(--d-edge);
    border-radius: 11px;
    padding: 8px 11px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--d-white);
    min-width: 0;
    text-align: start;
    width: 100%;
}

.darya-app .d-field:hover {
    border-color: var(--d-navy);
}

.darya-app .d-field .d-k {
    font-size: var(--d-fs-micro);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--d-muted);
    font-weight: 600;
}

.darya-app .d-field .d-v {
    font-size: var(--d-fs-cap);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    width: 100%;
}

.darya-app .d-field .d-v:focus {
    outline: 0;
}

/* ---- chip -------------------------------------------------------------- */
.darya-app .d-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.darya-app .d-chips::-webkit-scrollbar {
    display: none;
}

.darya-app .d-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
    padding: 0 15px;
    border-radius: 22px;
    border: 1px solid var(--d-edge);
    font-size: var(--d-fs-sub);
    white-space: nowrap;
    background: var(--d-white);
    color: var(--d-ink);
    text-decoration: none;
    transition: background .12s ease, border-color .12s ease;
}

.darya-app .d-chip:hover {
    border-color: var(--d-navy);
}

.darya-app .d-chip.is-on {
    background: var(--d-navy);
    border-color: var(--d-navy);
    color: var(--d-white);
}

/* ---- hero -------------------------------------------------------------- */
.darya-app .d-hero {
    background: var(--d-surface);
    border-radius: 14px;
    display: block;
    position: relative;
    overflow: hidden;
}

.darya-app .d-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.darya-app .d-hero-shade {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px 14px;
    background: linear-gradient(90deg, rgba(12, 28, 61, .78), rgba(12, 28, 61, .05));
}

[dir="rtl"] .darya-app .d-hero-shade {
    background: linear-gradient(270deg, rgba(12, 28, 61, .78), rgba(12, 28, 61, .05));
}

/* ---- item row ---------------------------------------------------------- */
.darya-app .d-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--d-line);
    width: 100%;
    text-align: start;
    color: inherit;
    text-decoration: none;
}

.darya-app .d-item:last-child {
    border-bottom: 0;
}

/* ---- badge ------------------------------------------------------------- */
.darya-app .d-badge {
    font-size: var(--d-fs-micro);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 4px 7px;
    border-radius: 5px;
    background: color-mix(in srgb, var(--d-success) 13%, transparent);
    color: var(--d-success);
    white-space: nowrap;
}

.darya-app .d-badge.is-brass {
    background: color-mix(in srgb, var(--d-gold) 22%, transparent);
    color: var(--d-gold-ink);
}

.darya-app .d-badge.is-muted {
    background: var(--d-surface);
    color: var(--d-muted);
}

/* ---- dots -------------------------------------------------------------- */
.darya-app .d-dots {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 7px;
}

.darya-app .d-dots i {
    width: 4px;
    height: 4px;
    border-radius: 2px;
    background: var(--d-line);
}

.darya-app .d-dots i.is-on {
    width: 16px;
    background: var(--d-navy);
}

/* ---- the car grid ------------------------------------------------------ */
/*
    The phone lists one card per row. A 1,400px page doing the same is a
    screenshot of a phone, so the card keeps the app's shape and the page
    decides how many fit beside each other.
*/
.darya-app .darya-car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.darya-app .darya-car-grid .d-card {
    display: flex;
    min-height: 100%;
}

/* ---- clearing the fixed header ----------------------------------------- */
/*
    The theme's header is `position: fixed` and 106px tall, and the pages it
    was built for all open with a full-bleed hero that starts underneath it on
    purpose. These pages open with a card, so without an offset the first one
    is behind the header and the page appears to start half way down.

    Only the first block on the page clears it; a second one is already in
    flow below the first.
*/
/*
    Only the homepage. Every other page opens with a breadcrumb band that has
    already cleared the header, so adding the offset there put a 250px hole
    between the breadcrumb and the content — which is exactly what it looked
    like on the account pages.
*/
#page-home .darya-app:first-of-type .d-shell {
    padding-top: calc(106px + 20px);
}

@media (max-width: 991.98px) {
    #page-home .darya-app:first-of-type .d-shell {
        padding-top: calc(70px + 16px);
    }
}

/* ---- page-level variants ----------------------------------------------- */
/*
    These were inline `style` attributes. The theme's HTML optimiser hoists an
    inline style into a generated class and moves it to a stylesheet, where it
    loses the specificity that made it win — `max-width: 1240px` on the element
    ended up behind `.darya-app .d-shell`, and the car grid rendered at phone
    width on a 1,400px page. Nothing in these templates is styled inline.
*/
.darya-app .d-shell.is-wide {
    max-width: 1240px;
}

.darya-app .d-offer {
    position: relative;
}

.darya-app .d-offer .d-card {
    padding: 0;
    overflow: hidden;
    border: 0;
}

.darya-app .d-offer .d-hero {
    height: 220px;
    width: 100%;
    display: block;
}

.darya-app .d-offer .d-t {
    color: #fff;
    font-size: 16px;
}

.darya-app .d-offer .d-sub {
    color: rgba(255, 255, 255, .8);
}

.darya-app .d-search {
    padding: 10px;
    gap: 8px;
}

.darya-app .d-search-dates {
    display: flex;
    gap: 8px;
}

.darya-app .d-search-dates .d-field {
    flex: 1;
}

/* the app aligns its chips to the reading edge, not to the centre */
.darya-app .d-chips {
    justify-content: flex-start;
}

.darya-app .d-section-title {
    font-size: 18px;
    margin-bottom: 12px;
}

.darya-app .d-car-card {
    gap: 10px;
}

.darya-app .d-car-card .d-hero {
    aspect-ratio: 16 / 10;
    width: 100%;
}

.darya-app .d-car-meta {
    gap: 4px;
}

.darya-app .d-car-foot {
    justify-content: space-between;
    margin-top: auto;
}

.darya-app .d-car-foot .d-col {
    gap: 0;
}

.darya-app .d-price-unit {
    font-size: 11.5px;
}

/* ---- the results row --------------------------------------------------- */
/*
    The prototype's results card laid out as it lays it out: a 96x66 thumbnail
    beside a column. It is the same card as the grid one — only the direction
    differs — so everything else is inherited.
*/
.darya-app .d-car-row {
    display: flex;
    gap: 10px;
    padding: 9px;
    align-items: stretch;
}

.darya-app .d-car-thumb {
    width: 128px;
    height: 88px;
    flex: 0 0 auto;
    border-radius: 10px;
}

.darya-app .d-car-row-body {
    flex: 1;
    gap: 3px;
    min-width: 0;
}

.darya-app .d-car-row-foot {
    justify-content: space-between;
    margin-top: auto;
}

/*
    A card that is a grid cell has to fill its cell, or a row of them ends up
    ragged when one name wraps to two lines and its neighbours do not.
*/
.darya-app.col-lg-3,
.darya-app.col-lg-4,
.darya-app.col-lg-6,
.darya-app.col-12 {
    display: flex;
    margin-bottom: 14px;
}

.darya-app.col-lg-3 > .d-card,
.darya-app.col-lg-4 > .d-card,
.darya-app.col-lg-6 > .d-card,
.darya-app.col-12 > .d-card {
    width: 100%;
}

/* ---- spec rows --------------------------------------------------------- */
/*
    The prototype's detail screen is built from one repeated row: a label on
    the reading edge, a value on the other, a hairline between them and none
    under the last. The specification panel, the price ladder and the rental
    terms are all the same component.
*/
.darya-app .d-spec-card {
    padding: 2px 12px;
}

.darya-app .d-spec {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--d-line);
}

.darya-app .d-spec:last-child {
    border-bottom: 0;
}

.darya-app .d-spec .d-k {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--d-muted);
    font-size: var(--d-fs-sub);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.darya-app .d-spec .d-v {
    font-size: var(--d-fs-cap);
    font-weight: 600;
    text-align: end;
}

.darya-app .d-spec.is-current {
    background: var(--d-surface);
    margin-inline: -12px;
    padding-inline: 12px;
    border-radius: 8px;
}

.darya-app .d-spec .d-k img,
.darya-app .d-spec .d-k svg {
    width: 17px;
    height: 17px;
    opacity: .75;
}

/* ---- the account area -------------------------------------------------- */
.darya-app .d-account-grid {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    gap: 52px;
    align-items: start;
}

@media (max-width: 900px) {
    .darya-app .d-account-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

.darya-app .d-account-rail {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 130px;
}

@media (max-width: 900px) {
    .darya-app .d-account-rail { position: static; }
}

.darya-app .d-account-who {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.darya-app .d-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.darya-app .d-account-name {
    font-size: 20px;
    margin-top: 8px;
}

.darya-app .d-account-nav .d-spec {
    text-decoration: none;
    color: inherit;
}

.darya-app .d-account-nav .d-spec .d-v {
    color: var(--d-muted);
}

.darya-app .d-account-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* a booking is a car row that happens to be in the past */
.darya-app .d-booking-row {
    text-decoration: none;
    color: inherit;
}

.darya-app .d-empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 32px;
}

/*
    The theme's own content container already pads 85px below the breadcrumb.
    A shell inside it must not add its own 52px on top of that, or the page
    opens with a hole where the first thing on it should be.
*/
.page-default-content .darya-app .d-shell,
.page-default-content .darya-app:first-of-type .d-shell {
    padding-top: 0;
}

/* ---- the booking page -------------------------------------------------- */
.darya-app .d-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--d-muted);
    margin-bottom: 24px;
}

.darya-app .d-steps b {
    color: var(--d-navy);
    font-weight: 700;
}

.darya-app .d-steps i {
    width: 22px;
    height: 1px;
    background: var(--d-line);
    display: inline-block;
}

.darya-app .d-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 52px;
    align-items: start;
}

@media (max-width: 991.98px) {
    .darya-app .d-checkout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/*
    The summary stays with the reader. On the phone it is a screen you go back
    to; on a page it never has to leave.
*/
.darya-app .d-checkout-summary {
    position: sticky;
    top: 130px;
}

@media (max-width: 991.98px) {
    .darya-app .d-checkout-summary { position: static; order: -1; }
}

.darya-app .d-checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/*
    The summary panel needs its own room: the plugin lays it out as a two-column
    table inside a 340px column, so a Tehran address wrapped to one word a line.
*/
.darya-app .d-checkout-summary .booking-information,
.darya-app .d-checkout-summary table,
.darya-app .d-checkout-summary .row {
    display: block;
    width: 100%;
}

.darya-app .d-checkout-summary td,
.darya-app .d-checkout-summary th {
    display: block;
    width: auto;
    padding: 2px 0;
    text-align: start;
}

.darya-app .d-checkout-summary img {
    max-width: 96px;
    height: auto;
    border-radius: 2px;
}
