/*
   The Angular look, applied to the Latte pages.

   /cz/sign/in and the few other pages still rendered by Nette share a domain
   and a session with the Angular app, so a visitor walks straight from one
   into the other - and used to land on Bootstrap 3 blue and a header built
   from different categories. This sheet carries the Angular design tokens
   (angular/src/styles.css, kept in step by hand) and restyles the header, the
   controls and the chrome around them to match.

   Loaded last, after bootstrap.min.css and style.css, so it overrides both
   without either of them being touched - those two also dress the admin and
   the account module, which are not in scope here.
*/

:root {
    --text-primary: #23201f;
    --text-secondary: #666666;
    --text-muted: #707070;
    --text-inverse: #ffffff;

    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f0;

    --border-color: #e0e0e0;
    --border-color-light: #eeeeee;

    --accent-red: #d51a1a;
    --accent-green: #237b66;

    --button-primary-bg: #23201f;
    --button-primary-color: #ffffff;
    --button-primary-hover-bg: #3a3633;

    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-size-base: 13px;
    --font-size-sm: 11px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-xxl: 24px;
    --line-height-body: 1.6;
    --line-height-heading: 1.2;
    --letter-spacing-wide: 0.05em;
    --letter-spacing-wider: 0.1em;

    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --border-radius-sm: 2px;
    --transition-speed: 0.2s;

    --header-height: 52px;
    --header-item-height: 42px;
    --header-gutter: 20px;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-wide);
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-xxl);
    font-weight: 400;
}

a {
    color: var(--text-primary);
    transition: color var(--transition-speed) ease;
}

a:hover,
a:focus {
    color: var(--text-secondary);
    text-decoration: none;
}

/* ----------------------------------------------------------------- icons */

/* The icon set the Angular header uses (@phosphor-icons/web, thin), so these
   pages show the same glyphs rather than Font Awesome 4's. Self-hosted: the
   Angular build fingerprints its copy of the font, and a hand-written sheet
   cannot follow a name that changes with the bundle.

   Only the handful of icons the header needs are declared. The upstream
   style.css carries ~1500 rules and 85 kB for them; add a codepoint from
   angular/node_modules/@phosphor-icons/web/src/thin/style.css when a new icon
   is needed here. */
@font-face {
    font-family: "Phosphor-Thin";
    src: url("phosphor/Phosphor-Thin.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

.ph-thin {
    font-family: "Phosphor-Thin" !important;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ph-thin.ph-user:before { content: "\e4c2"; }
.ph-thin.ph-user-circle:before { content: "\e4c4"; }
.ph-thin.ph-tray:before { content: "\e4aa"; }
.ph-thin.ph-magnifying-glass:before { content: "\e30c"; }
.ph-thin.ph-basket:before { content: "\e964"; }
.ph-thin.ph-gear:before { content: "\e270"; }

/* ---------------------------------------------------------------- header */

.site-header {
    /* sticky, not fixed: it pins on scroll like the Angular bar but stays in
       the flow, so nothing has to reserve its height. This sheet is included
       by every layout that pulls in _Shared/@js_css.latte, and a body padding
       for a header a layout does not render would push that page down by 52px
       for no reason. */
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-primary);
}

.site-header-row {
    display: flex;
    align-items: center;
    height: var(--header-height);
    padding: 0 var(--header-gutter);
}

/* Equal basis on the two side cells is what centres the logo: each takes half
   of what the middle cell leaves, at any width. Same rule as header.css. */
.site-header-menu,
.site-header-toolbar {
    flex: 1 1 0;
    min-width: 0;
}

.site-header-menu {
    align-self: stretch;
}

.site-header-logo {
    flex: 0 0 auto;
}

.site-header-logo a {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* style.css takes #main-logo out of flow at 60px for the old header; in here
   it is an ordinary flex child, sized to one menu entry. */
.site-header-logo #main-logo {
    position: static;
    height: var(--header-item-height);
    width: auto;
}

.site-nav {
    height: 100%;
}

.site-nav > ul {
    display: flex;
    /* stretch, not center: the flyout hangs at the bar's bottom edge, while an
       entry is only --header-item-height of the --header-gutter-tall bar. The
       10px that left over sat between the two and belonged to neither, so a
       cursor crossing it slowly lost the hover and the dropdown closed under
       it. A full-height row reaches the flyout with nothing in between. */
    align-items: stretch;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav-item {
    position: static;
    display: flex;
    align-items: center;
}

.site-nav-item > a,
.site-nav-item > .site-menu-heading {
    display: inline-block;
    padding: 5px var(--space-sm) 7px;
    line-height: 30px;
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wider);
    text-transform: uppercase;
    color: var(--text-primary);
    cursor: pointer;
}

/* -------------------------------------------------------------- dropdown */

/* No Angular on these pages, so the flyout opens on hover in CSS. It hangs
   off .site-header rather than the item, so it can span the viewport the way
   .subcategories-flyout does. */
.site-flyout {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    padding: var(--space-lg) 0;
}

.site-nav-item:hover .site-flyout,
.site-nav-item:focus-within .site-flyout {
    display: block;
}

.site-flyout-grid {
    display: grid;
    grid-template-columns: repeat(6, calc(100vw / 6));
    width: 100vw;
}

.site-flyout-column {
    padding: 0 var(--space-lg);
    min-width: 0;
}

.site-flyout-header {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-primary);
}

.site-flyout-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-flyout-list li {
    margin-bottom: 4px;
}

.site-flyout-list a {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.site-flyout-list a:hover {
    color: var(--text-primary);
}

/* --------------------------------------------------------------- toolbar */

/* Measured off app-top-user-menu's .xs-top-toolbar so the two bars line up:
   2px between the buttons, 6px/8px inside one, a 16px box with the glyph at
   1.4em, and the currency mark at 13.6px semibold beside the flag. */
.site-header-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.site-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    line-height: 1;
}

.site-toolbar-btn .trigger-currency,
.trigger-currency.site-toolbar-btn {
    font-size: 13.6px;
    font-weight: 600;
}

.site-toolbar-btn:hover,
.site-toolbar-btn:focus {
    color: var(--text-secondary);
}

.site-toolbar-btn .ph-thin {
    font-size: 1.4em;
}

.site-cart {
    position: relative;
}

.site-cart .badge {
    /* the grey the Angular badge rests at between its add-to-cart pulses */
    background: #949b9f;
    color: var(--text-inverse);
    font-size: var(--font-size-sm);
    padding: 2px 5px;
}

.site-header .dropdown-menu {
    border-radius: 5px;
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    font-size: var(--font-size-base);
}

.site-header .dropdown-menu > li > a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 4px 13px;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.site-header .dropdown-menu > li > a .ph-thin {
    font-size: var(--font-size-lg);
    width: 1.2857em;
    text-align: center;
}

.site-header .dropdown-menu > li > a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* An id selector, because style.css paints #header-info Bootstrap blue and a
   class would lose to it. scripts.js toggles the element's inline display, so
   the rule only has to describe how it looks once shown. */
#header-info.site-cookie-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) var(--header-gutter);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

#header-info.site-cookie-bar .close {
    font-size: var(--font-size-lg);
    opacity: 0.6;
    color: var(--text-primary);
    text-shadow: none;
}

.site-search-dropdown {
    padding: var(--space-md);
    min-width: 280px;
}

.site-search-form .form-control {
    margin-bottom: var(--space-sm);
    width: 100%;
}

.site-search-form .btn {
    width: 100%;
}

/* Angular swaps the bar for a drawer below this width; there is no drawer
   here, so the entries stay and scroll sideways instead - losing the menu
   altogether on a phone would be worse than losing the centred logo. The
   flyout goes: it opens on hover, which a touch screen cannot do. */
@media all and (max-width: 991px) {
    .site-header-row {
        padding: 0 12px;
        gap: var(--space-sm);
    }

    .site-header-menu {
        flex: 1 1 auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .site-header-menu::-webkit-scrollbar {
        display: none;
    }

    .site-nav > ul {
        flex-wrap: nowrap;
    }

    .site-nav-item > a,
    .site-nav-item > .site-menu-heading {
        white-space: nowrap;
        padding-left: 6px;
        padding-right: 6px;
    }

    .site-flyout {
        display: none;
    }

    .site-header-toolbar {
        flex: 0 0 auto;
        gap: 2px;
    }
}

/* -------------------------------------------------------------- controls */

.btn {
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    font-size: var(--font-size-base);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    text-shadow: none;
    box-shadow: none;
    background-image: none;
}

.btn-primary,
.btn-success,
.btn-info {
    background: var(--button-primary-bg);
    border-color: var(--button-primary-bg);
    color: var(--button-primary-color);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-success:hover, .btn-success:focus, .btn-success:active,
.btn-info:hover, .btn-info:focus, .btn-info:active {
    background: var(--button-primary-hover-bg);
    border-color: var(--button-primary-hover-bg);
    color: var(--button-primary-color);
}

.btn-default {
    background: var(--bg-primary);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-default:hover,
.btn-default:focus {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

/* The newsletter subscribe button is the only btn-warning on these pages, and
   amber is not in the palette. */
.btn-warning {
    background: var(--button-primary-bg);
    border-color: var(--button-primary-bg);
    color: var(--button-primary-color);
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    background: var(--button-primary-hover-bg);
    border-color: var(--button-primary-hover-bg);
    color: var(--button-primary-color);
}

/* style.css paints this one by id, which a class cannot outrank. */
.site-search-dropdown #frm-searchBarForm button {
    background-color: var(--button-primary-bg);
    border: 1px solid var(--button-primary-bg);
    color: var(--button-primary-color);
    font-size: var(--font-size-base);
    padding: 8px 12px;
}

.site-search-dropdown #frm-searchBarForm button:hover {
    background-color: var(--button-primary-hover-bg);
    border-color: var(--button-primary-hover-bg);
}

.form-control {
    border-radius: var(--border-radius-sm);
    border-color: var(--border-color);
    box-shadow: none;
    /* 16px stops iOS Safari zooming the page on focus */
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    height: auto;
    padding: 10px 12px;
}

.form-control:focus {
    border-color: var(--text-primary);
    box-shadow: none;
}

label,
.control-label {
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 400;
}

hr {
    border-top-color: var(--border-color-light);
}

/* ---------------------------------------------------------------- chrome */

.alert {
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.alert-danger,
.alert-error {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.alert-success {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

footer,
#footer {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
}

footer a,
#footer a {
    color: var(--text-secondary);
}

footer a:hover,
#footer a:hover {
    color: var(--text-primary);
}

footer h2,
footer h3,
footer h4,
#footer h2,
#footer h3,
#footer h4 {
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wider);
    text-transform: uppercase;
}

/* --------------------------------------------------------------- account */

/* AccountModule extends @layout_min.latte, so it now carries this header -
   and with it a neutral bar over Bootstrap 3's #337ab7 panels, #428bca links
   and blue table heads. These rules recolour that chrome; the layout, the
   grid and the markup are left alone. They reach no further than the layouts
   that include _Shared/@js_css.latte: AdminModule has its own copy. */
.panel {
    border-radius: var(--border-radius-sm);
    box-shadow: none;
}

.panel,
.panel-default,
.panel-primary,
.panel-info,
.panel-success,
.panel-warning {
    border-color: var(--border-color);
}

.panel > .panel-heading,
.panel-default > .panel-heading,
.panel-primary > .panel-heading,
.panel-info > .panel-heading,
.panel-success > .panel-heading,
.panel-warning > .panel-heading {
    background: var(--bg-secondary);
    background-image: none;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.panel > .panel-footer,
.panel-primary > .panel-footer {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.panel-title {
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wider);
    text-transform: uppercase;
    color: var(--text-primary);
}

.panel-primary > .panel-heading + .panel-collapse > .panel-body {
    border-top-color: var(--border-color);
}

/* Content links, in Bootstrap's #337ab7 by default. Both layouts wrap their
   content in #page-content, so this covers the account screens and the public
   Latte pages alike, and leaves the header, footer and sidebar to their own
   rules above. */
#page-content a,
#page-content .btn-link {
    color: var(--text-primary);
}

#page-content a:hover,
#page-content a:focus {
    color: var(--text-secondary);
}

#page-content .btn-primary,
#page-content .btn-success,
#page-content .btn-info,
#page-content .btn-danger,
#page-content .btn-warning {
    color: var(--button-primary-color);
}

/* style.css paints the account tables' head blue on the thead itself */
.table-account thead {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.table > thead > tr > th {
    border-bottom-color: var(--border-color);
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 400;
}

.table > tbody > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > thead > tr > th {
    border-color: var(--border-color);
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background: var(--bg-secondary);
}

/* the sidebar: blue for "where you are" becomes the body colour in bold,
   the way the Angular menu marks its active row */
.navbar-account a {
    border-top-color: var(--border-color);
    color: var(--text-primary);
}

.navbar-account li.active > a,
.navbar-account .submenu li.active a {
    color: var(--text-primary);
    font-weight: 600;
}

.navbar-account a:hover {
    background-color: var(--bg-secondary);
}

.nav-tabs > li > a {
    color: var(--text-secondary);
    border-radius: 0;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: var(--text-primary);
    border-color: var(--border-color);
    border-bottom-color: transparent;
}

.pagination > li > a,
.pagination > li > span {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover {
    background: var(--button-primary-bg);
    border-color: var(--button-primary-bg);
    color: var(--text-inverse);
}
