/* Style frontendu Składu Opału. Kolor marki: #F26A21.
   !important tam, gdzie motyw mógłby narzucać własne style na
   input/button/select — analogicznie jak w formularzu zarybienia. */

:root {
    --opal-brand: #F26A21;
}

.opal-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    margin: 20px 0 60px;
}

.opal-card {
    border: 1px solid #eee;
    border-radius: 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 16px;
}

.opal-card-img {
    aspect-ratio: 4 / 3;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 20px;
}

.opal-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.opal-grid--simple .opal-card {
    padding: 26px 16px 16px;
}

.opal-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.opal-grid--simple .opal-card-title,
.opal-grid--simple .opal-card-desc {
    text-align: center;
}

.opal-select-label {
    display: block;
    font-size: 12px;
    color: #777;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.opal-add-notice {
    font-size: 13px;
    background: #fff3e9;
    border: 1px solid #ffd9b8;
    color: #8a4b16 !important;
    padding: 8px 10px;
    border-radius: 6px;
    margin-top: 8px;
    display: none;
}

.opal-add-notice a {
    color: var(--opal-brand) !important;
    font-weight: 700;
    text-decoration: underline;
}

/* Kafelek szczegółowy (widok kategorii) — poziomy układ */
.opal-grid--detailed {
    grid-template-columns: 1fr;
}

.opal-card--detailed {
    flex-direction: row;
    gap: 20px;
    align-items: center;
}

.opal-card--detailed .opal-card-img {
    width: 286px;
    flex: 0 0 286px;
    aspect-ratio: 1 / 1;
    align-self: center;
    margin-bottom: 0;
}

.opal-card--detailed .opal-card-body {
    flex: 1;
    justify-content: center;
}

@media (max-width: 700px) {
    .opal-card--detailed {
        flex-direction: column;
    }
    .opal-card--detailed .opal-card-img {
        width: 100%;
        flex: none;
    }
}

.opal-card-title {
    margin: 0;
    font-size: 18px;
}

.opal-card-desc {
    margin: 0;
    color: #666;
    font-size: 14px;
    flex: 1;
}

.opal-card-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 6px 0 4px;
}

.opal-card-col-opis {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
}

.opal-card-col-spec {
    font-size: 13px;
}

.opal-card-col-spec .opal-spec-table {
    margin-top: 0;
}

@media (max-width: 700px) {
    .opal-card-columns {
        grid-template-columns: 1fr;
    }
}

.opal-spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.opal-spec-table th,
.opal-spec-table td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 13px;
    color: #1a1a1a;
}

.opal-spec-table th {
    font-weight: 600;
    width: 45%;
}

select.opal-unit-select {
    padding: 0 8px;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    background: #fff !important;
    color: #1a1a1a !important;
    font-size: 13px;
    max-width: 100%;
    height: 34px;
}

.opal-unit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.opal-unit-row .opal-select-label {
    flex: 0 0 33%;
    margin-bottom: 0;
    white-space: nowrap;
}

.opal-unit-row select.opal-unit-select {
    flex: 1 1 67%;
    width: 67%;
}

.opal-qty-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 10px;
}

/* Kafelek szczegółowy: wszystko w jednej linii */
.opal-order-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.opal-order-bar .opal-select-label {
    flex: 0 0 auto;
    margin-bottom: 0;
    white-space: nowrap;
}

.opal-order-bar select.opal-unit-select {
    flex: 0 1 180px;
    min-width: 140px;
}

.opal-order-bar .opal-btn {
    margin-top: 0;
}

.opal-card--detailed .opal-select-label {
    color: var(--opal-brand);
    font-weight: 700;
}

.opal-card--detailed .opal-qty-btn {
    color: var(--opal-brand) !important;
    border-color: var(--opal-brand);
}

.opal-qty {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
    height: 34px !important;
}

.opal-qty-btn {
    background: #f5f5f5 !important;
    border: none !important;
    width: 26px !important;
    height: 34px !important;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    color: #333 !important;
    padding: 0 !important;
}

.opal-qty-input {
    width: 32px !important;
    height: 34px !important;
    text-align: center;
    border: none !important;
    -moz-appearance: textfield;
    font-size: 14px;
    padding: 0 !important;
    box-sizing: border-box;
}

.opal-line-total {
    font-weight: 700;
    color: var(--opal-brand);
    text-align: right;
}

.opal-btn {
    padding: 10px 16px !important;
    border-radius: 6px !important;
    border: none !important;
    background: var(--opal-brand) !important;
    color: #fff !important;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 6px;
}

.opal-btn:hover {
    opacity: 0.9;
}

.opal-btn.opal-added {
    background: #2e7d32 !important;
}

.opal-empty {
    color: #777;
    padding: 20px 0;
}

/* --- Cennik --- */

.opal-cennik-wrapper {
    overflow-x: auto;
    margin: 20px 0 40px;
}

.opal-cennik-tabela {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.opal-cennik-tabela thead tr {
    background: var(--opal-brand);
}

.opal-cennik-tabela thead th {
    color: #fff !important;
    font-weight: 700;
    text-align: left;
    padding: 10px 12px;
    white-space: nowrap;
}

.opal-cennik-tabela td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    white-space: nowrap;
}

.opal-cennik-nazwa {
    color: #1a1a1a !important;
    font-weight: 600;
    text-decoration: none !important;
}

.opal-cennik-nazwa:hover {
    color: var(--opal-brand) !important;
}

.opal-cennik-dodaj {
    background: var(--opal-brand) !important;
    border: none !important;
    border-radius: 6px !important;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff !important;
    padding: 0 !important;
    line-height: 0 !important;
}

.opal-cennik-dodaj svg {
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    fill: none !important;
    stroke: #fff !important;
    stroke-width: 2 !important;
    color: #fff !important;
    pointer-events: none;
}

/* --- Popup dodawania z cennika --- */

.opal-cennik-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opal-cennik-popup-inner {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    width: 320px;
    max-width: 90%;
    position: relative;
}

.opal-cennik-popup-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none !important;
    border: none !important;
    font-size: 22px;
    cursor: pointer;
    color: #888 !important;
    line-height: 1;
}

.opal-cennik-popup-inner h4 {
    margin: 0 0 16px;
    padding-right: 20px;
}

.opal-cennik-popup-inner .opal-btn {
    width: 100%;
    margin-top: 10px;
}

/* --- Mini-koszyk do nagłówka/menu --- */

.opal-mini-cart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    color: var(--opal-brand) !important;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.opal-mini-cart-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.opal-mini-cart-icon {
    color: var(--opal-brand);
    width: 24px;
    height: 24px;
}

.opal-mini-cart-count {
    position: absolute;
    top: -8px;
    right: -9px;
    background: var(--opal-brand);
    color: #fff !important;
    border-radius: 999px;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    padding: 0 4px;
    font-weight: 700;
    line-height: 1;
}

.opal-mini-cart-total {
    color: var(--opal-brand) !important;
}

/* --- Strona zamówienia --- */

#opal-zamowienie-wrapper {
    max-width: 100%;
    width: 100%;
}

.opal-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.opal-thankyou {
    text-align: center;
    padding: 50px 20px;
}

.opal-thankyou h3 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #333;
}

.opal-thankyou p {
    font-size: 15px;
    color: #555;
    max-width: 560px;
    margin: 0 auto 10px;
    line-height: 1.6;
}

.opal-empty-state h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
}

.opal-btn-pill {
    display: inline-block;
    background: var(--opal-brand) !important;
    color: #fff !important;
    padding: 12px 28px !important;
    border-radius: 999px !important;
    font-weight: 700;
    text-decoration: none !important;
}

.opal-btn-pill:hover {
    opacity: 0.9;
}

.opal-delivery-note {
    font-size: 13px;
    color: #777;
    margin: -20px 0 28px;
}

.opal-terms {
    font-weight: normal !important;
    font-size: 14px;
}

.opal-terms a {
    color: var(--opal-brand) !important;
}

.opal-koszyk-tabela {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 32px;
}

.opal-koszyk-tabela thead tr {
    background: var(--opal-brand);
}

.opal-koszyk-tabela thead th {
    color: #fff !important;
    font-weight: 700;
}

.opal-koszyk-tabela th,
.opal-koszyk-tabela td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.opal-koszyk-tabela img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.opal-koszyk-remove {
    background: none !important;
    border: 1px solid #c0392b !important;
    color: #c0392b !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
    cursor: pointer;
    font-size: 12px;
}

.opal-form {
    max-width: 50%;
}

@media (max-width: 1199px) and (min-width: 900px) {
    .opal-form {
        max-width: 70%;
    }
}

@media (max-width: 899px) {
    .opal-form {
        max-width: 100%;
    }
}

.opal-section {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.opal-section h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.opal-field {
    display: block;
    margin-bottom: 14px;
    font-weight: 500;
}

.opal-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .opal-field-row {
        grid-template-columns: 1fr;
    }
}

.opal-input {
    width: 100%;
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    box-sizing: border-box;
    color: #1a1a1a !important;
    background: #fff !important;
    font-weight: normal;
}

.opal-radio {
    display: block;
    margin-bottom: 8px;
    font-weight: normal;
}

.opal-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px 24px;
    margin-top: 12px;
    margin-bottom: 22px;
}

.opal-checkbox-grid label {
    font-weight: normal;
    display: block;
}

.opal-conditional {
    margin-top: 14px;
}

.opal-info {
    font-size: 13px;
    color: #777;
    margin-bottom: 18px;
}

.opal-pesel-input {
    margin-top: 14px;
}

.opal-pesel-section {
    margin-top: 24px;
}

.opal-pesel-section h4 {
    font-size: 1em;
    font-weight: 500;
    margin: 0 0 6px;
    color: #1a1a1a;
}

.opal-warning {
    margin-top: 10px;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    border-radius: 4px;
    color: #664d03;
    font-size: 14px;
}

.opal-submit-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-top: 10px;
}

.opal-submit {
    font-size: 15px;
    padding: 12px 22px !important;
    margin-top: 0 !important;
}

.opal-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 4px;
    display: none;
}

.opal-success {
    background: #d1e7dd;
    color: #0f5132 !important;
    border: 1px solid #a3cfbb;
}

.opal-error {
    background: #f8d7da;
    color: #842029 !important;
    border: 1px solid #f1aeb5;
}

@media (max-width: 600px) {
    .opal-unit-row {
        flex-direction: column;
        align-items: stretch;
    }
    .opal-unit-row .opal-select-label,
    .opal-unit-row select.opal-unit-select {
        flex: 1 1 auto;
        width: 100%;
    }
    .opal-line-total {
        text-align: left;
    }
}
