/*
Theme Name: Earphone Store Theme
Theme URI: https://example.com
Author: Earphone Store
Description: A single-product earphone store theme for WordPress.
Version: 1.1
License: GNU General Public License v2 or later
Text Domain: earphone-store-theme
*/

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a { color: #e84040; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   LAYOUT
============================================================ */
.site-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   HEADER
============================================================ */
.site-header {
    background-color: #1a1a2e;
    color: #fff;
    padding: 18px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

.site-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
}

.site-title span { color: #e84040; }
.site-tagline { font-size: 0.85rem; opacity: 0.7; margin-top: 2px; }

/* ============================================================
   MAIN CONTENT
============================================================ */
.site-main { padding: 40px 0 60px; }

/* ============================================================
   PRODUCT PAGE
============================================================ */
.product-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 40px;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.product-image-col {
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-right: 1px solid #eee;
    position: relative;
}

.product-image-col img {
    border-radius: 8px;
    max-height: 400px;
    object-fit: contain;
    width: 100%;
}

.product-image-placeholder {
    width: 100%;
    height: 350px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 5rem;
}

/* Discount ribbon on image */
.discount-ribbon {
    position: absolute;
    top: 18px;
    left: 18px;
    background: #e84040;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(232,64,64,0.4);
    z-index: 2;
}

.product-info-col { padding: 40px; }

.product-category-badge {
    display: inline-block;
    background: #fef0f0;
    color: #e84040;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.product-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
    line-height: 1.2;
}

/* ---- Pricing block ---- */
.product-price-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.price-original {
    font-size: 1.25rem;
    color: #aaa;
    text-decoration: line-through;
    font-weight: 500;
}

.price-sale {
    font-size: 2.2rem;
    font-weight: 800;
    color: #e84040;
}

.price-sale .currency {
    font-size: 1.2rem;
    vertical-align: super;
    font-weight: 600;
}

.discount-badge {
    display: inline-flex;
    align-items: center;
    background: #e84040;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.product-description {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.8;
    font-size: 0.98rem;
}

/* ============================================================
   ORDER FORM
============================================================ */
.order-form-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    padding: 40px;
}

.order-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.order-form-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group { margin-bottom: 22px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: #444;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label .required-star { color: #e84040; margin-left: 2px; }

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 1rem;
    color: #333;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #e84040;
    box-shadow: 0 0 0 3px rgba(232,64,64,0.1);
    background: #fff;
}

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

/* ---- Quantity ---- */
.quantity-input-wrapper { display: flex; align-items: center; gap: 12px; }

.qty-btn {
    width: 40px;
    height: 44px;
    border: 2px solid #e8e8e8;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #333;
    flex-shrink: 0;
}

.qty-btn:hover { border-color: #e84040; background: #fef0f0; color: #e84040; }

.quantity-input-wrapper input[type="number"] {
    width: 80px;
    text-align: center;
    flex-shrink: 0;
    -moz-appearance: textfield;
}

.quantity-input-wrapper input[type="number"]::-webkit-inner-spin-button,
.quantity-input-wrapper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---- Coupon field ---- */
.coupon-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.coupon-input-wrapper input[type="text"] {
    flex: 1;
    letter-spacing: 1px;
}

.coupon-apply-btn {
    padding: 0 22px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.coupon-apply-btn:hover { background: #0f3460; }
.coupon-apply-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.coupon-remove-btn {
    padding: 0 16px;
    background: #f5f5f5;
    color: #c0392b;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.coupon-remove-btn:hover { background: #fef0f0; border-color: #e84040; }

.coupon-feedback {
    display: block;
    font-size: 0.85rem;
    margin-top: 6px;
    min-height: 1.2em;
}

.coupon-feedback--success { color: #27ae60; font-weight: 600; }
.coupon-feedback--error   { color: #e84040; }

/* ---- Order summary bar ---- */
.order-summary-bar {
    background: #f9f9f9;
    border: 2px dashed #e8e8e8;
    border-radius: 8px;
    padding: 18px 22px;
    margin-bottom: 24px;
}

.summary-lines { display: flex; flex-direction: column; gap: 8px; }

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

.summary-label { color: #666; font-size: 0.9rem; }

.summary-subtotal {
    color: #888;
    font-size: 1rem;
    font-weight: 600;
}

.coupon-discount-label { color: #27ae60; font-size: 0.88rem; }

.summary-discount-amt {
    color: #27ae60;
    font-size: 1rem;
    font-weight: 700;
}

.summary-total-line {
    border-top: 1px solid #e8e8e8;
    padding-top: 8px;
    margin-top: 4px;
}

.summary-total-label {
    font-weight: 700;
    color: #333;
    font-size: 1rem;
}

.summary-total {
    font-size: 1.6rem;
    font-weight: 800;
    color: #e84040;
}

/* ---- Submit button ---- */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #e84040 0%, #c0392b 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.submit-btn:hover  { opacity: 0.93; transform: translateY(-1px); }
.submit-btn:active { transform: translateY(0); }

/* ============================================================
   FORM ERRORS
============================================================ */
.form-error-box {
    background: #fff5f5;
    border: 1px solid #f5c6c6;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    color: #c0392b;
}

.form-error-box ul { padding-left: 18px; margin-top: 6px; }
.form-error-box ul li { margin-bottom: 4px; font-size: 0.9rem; }

.field-error { color: #e84040; font-size: 0.8rem; margin-top: 4px; display: block; }

.form-group input.has-error,
.form-group textarea.has-error,
.form-group select.has-error { border-color: #e84040; }

/* ============================================================
   THANK YOU PAGE
============================================================ */
.thankyou-wrapper { max-width: 600px; margin: 40px auto; text-align: center; }

.thankyou-icon {
    width: 90px; height: 90px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.8rem; color: #fff;
    box-shadow: 0 4px 20px rgba(39,174,96,0.35);
}

.thankyou-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    padding: 50px 40px;
}

.thankyou-title { font-size: 1.8rem; font-weight: 700; color: #1a1a2e; margin-bottom: 16px; }
.thankyou-message { color: #666; font-size: 1.05rem; line-height: 1.8; margin-bottom: 30px; }
.thankyou-message strong { color: #1a1a2e; }

.back-btn {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, #e84040 0%, #c0392b 100%);
    color: #fff; border-radius: 8px;
    font-weight: 700; font-size: 1rem;
    transition: opacity 0.2s; text-decoration: none;
}

.back-btn:hover { opacity: 0.9; text-decoration: none; color: #fff; }

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
    .product-layout { grid-template-columns: 1fr; }

    .product-image-col {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 30px;
    }

    .product-info-col { padding: 30px; }

    .form-row { grid-template-columns: 1fr; gap: 0; }

    .product-title { font-size: 1.5rem; }

    .order-form-section { padding: 28px 20px; }

    .thankyou-card { padding: 36px 20px; }

    .coupon-input-wrapper { flex-wrap: wrap; }
    .coupon-apply-btn,
    .coupon-remove-btn { padding: 10px 18px; }
}

@media (max-width: 480px) {
    .site-title { font-size: 1.2rem; }
    .price-sale { font-size: 1.8rem; }
    .product-price-wrapper { gap: 8px; }
}
